FreeBSD/src 6fd7e55sys/fs/nfsserver nfs_nfsdsubs.c nfs_nfsdport.c

nfsd: Fix handling of hidden/system during Open/Create

When an NFSv4.n client specifies settings for the archive,
hidden and/or system attributes during a Open/Create, the
Open/Create fails for ZFS.  This is caused by ZFS doing
a secpolicy_xvattr() call, which fails for non-root.
If this check is bypassed, ZFS panics.

This patch resolves the problem by disabling va_flags
for the VOP_CREATE() call in the NFSv4.n server and
then setting the flags with a subsequent VOP_SETATTR().

This problem only affects FreeBSD-15 and main, since the
archive, system and hidden attributes are not enabled
for FreeBSD-14.

I think a similar problem exists for the NFSv4.n
Open/Create/Exclusive_41, but that will be resolved
in a future commit.

    [8 lines not shown]
DeltaFile
+38-0sys/fs/nfsserver/nfs_nfsdsubs.c
+11-0sys/fs/nfsserver/nfs_nfsdport.c
+49-02 files

FreeBSD/src 102400esys/vm swap_pager.c

swap_pager_getpages(): assert that bp->b_pages[] is accessed in bounds

(cherry picked from commit b02ddb59e64620733a6cbc48fb1d0583a62fef78)
DeltaFile
+3-0sys/vm/swap_pager.c
+3-01 files

FreeBSD/src b3e6c8eshare/man/man7 tuning.7

tuning.7: wording fixes

(cherry picked from commit 6f41575a94b310614f5ffcee215aee48ced4ad2d)
DeltaFile
+2-2share/man/man7/tuning.7
+2-21 files

FreeBSD/src 1f6db7dsys/vm swap_pager.c

swap_release_by_cred*(): give some additional info on panics due to underflow

(cherry picked from commit 7361727d4584b5e303183c836497ae2754ce0e53)
DeltaFile
+4-2sys/vm/swap_pager.c
+4-21 files

FreeBSD/src 95eec98sys/vm swap_pager.c

vm/swap_pager.c: silence compiler warning

(cherry picked from commit 325baf00735756d024b903bfcee50b4f09e90129)
DeltaFile
+1-1sys/vm/swap_pager.c
+1-11 files

FreeBSD/src 9dbc47dsys/vm vm_map.c

vm_map_entry_delete(): fix the calculation of swap release

(cherry picked from commit acb71820d68bd0dd98964240727e251bc62c92de)
DeltaFile
+1-1sys/vm/vm_map.c
+1-11 files

FreeBSD/src a4123acsys/kern uipc_shm.c, sys/vm vm_object.c vm_map.c

vm_object: remove the charge member

(cherry picked from commit d160447129fe060b28bcd6ba429d17afdf494ff2)
DeltaFile
+27-19sys/vm/vm_object.c
+22-23sys/vm/vm_map.c
+2-6sys/vm/swap_pager.c
+2-3sys/vm/vm_fault.c
+1-3sys/vm/vm_object.h
+0-2sys/kern/uipc_shm.c
+54-561 files not shown
+54-587 files

FreeBSD/src a6cc48esys/kern kern_sendfile.c

sendfile: remove calculation of unused bsize

(cherry picked from commit 3fe275c1ef45d452d1adc537b7ec1ca6444739ba)
DeltaFile
+3-6sys/kern/kern_sendfile.c
+3-61 files

FreeBSD/src 7768be6share/man/man7 tuning.7

tuning.7: use the correct word for collapsing

(cherry picked from commit 8cd687a726a8b6cc29f573cba7d6c7ecb683a954)
DeltaFile
+1-1share/man/man7/tuning.7
+1-11 files

FreeBSD/src 0ab96c9sys/vm swap_pager.c vm_map.c

rfork(2): fix swap accounting in vmspace_unshare()

(cherry picked from commit de770681234d001a1f4cdb8121179331dc3a2def)
DeltaFile
+8-2sys/vm/swap_pager.c
+7-0sys/vm/vm_map.c
+1-0sys/vm/vm.h
+16-23 files

FreeBSD/src 2a27aefsys/vm swap_pager.c

swap_pager_getpages(): some pages from ma[] might be bogus

(cherry picked from commit d198ad51ea73bbb162336923a387f52b0b1c1f1d)
DeltaFile
+29-8sys/vm/swap_pager.c
+29-81 files

FreeBSD/src 10af3b3share/man/man7 tuning.7

tuning.7: add more explanation about swap (over-)accounting

(cherry picked from commit 457b940bfb6a228af1281f357b627ecf1e26fea5)
DeltaFile
+15-0share/man/man7/tuning.7
+15-01 files

FreeBSD/src 99fab30sys/vm vm_object.c

vm_object_coalesce(): simplify common expression

(cherry picked from commit e7053d9a126a60b3c0b1348b6c5131b5f2025894)
DeltaFile
+7-6sys/vm/vm_object.c
+7-61 files

FreeBSD/src 1e1727asys/vm vm_object.c

vm_object_coalesce(): do not account holes twice

(cherry picked from commit 353ba3bf08fdef69b77e3e565435e50784a51412)
DeltaFile
+7-4sys/vm/vm_object.c
+7-41 files

FreeBSD/src 2499392sys/vm vm_map.c vm_object.c

vm_object_coalesce(): return swap reservation back if overcharged

(cherry picked from commit 7685aaea8850f5b6995a17740a016019e0956c70)
DeltaFile
+30-14sys/vm/vm_map.c
+31-10sys/vm/vm_object.c
+7-1sys/vm/vm_object.h
+68-253 files

FreeBSD/src 84cab08sys/vm vm_object.c

vm_object_coalesce(): remove commented out code

(cherry picked from commit efcb109940ca607130af4498e1e33b54c58ba43c)
DeltaFile
+1-12sys/vm/vm_object.c
+1-121 files

FreeBSD/src f3de667sys/netinet6 in6_ifattach.c in6_var.h

netinet6: free in6_ifextra with epoch_call(9)

This is expected to fix the old in6_selecthlim() panics.  The nature of
the panic is that a packet sending thread will obtain the struct ifnet
pointer locklessly and then pick the if_inet6 pointer from it and
dereference it. While the struct ifnet is freed via epoch_call(9), the
struct in6_ifextra until this change was not.  For the forwarded packets,
or locally originated non-TCP packets we were probably safe due to the old
if_dead trick.  But locally originated TCP packets may dereference
in6_ifextra via direct call into in6_selecthlim() from the tcp_output(),
before ip6_output().

NB: hypothetically a similar problem also applies to IPv4's if_inet pointer,
but there are no known panics, yet.

PR:                     279653
Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54728
DeltaFile
+20-5sys/netinet6/in6_ifattach.c
+2-0sys/netinet6/in6_var.h
+22-52 files

FreeBSD/src cba9f88sys/netinet6 mld6.c mld6_var.h

netinet6: embed struct mld_ifsoftc into struct in6_ifextra

In mld_domifdetach() don't search the global list.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54727
DeltaFile
+13-41sys/netinet6/mld6.c
+2-20sys/netinet6/mld6_var.h
+15-1sys/netinet6/in6_var.h
+1-2sys/netinet6/in6.c
+0-1sys/netinet6/ip6_input.c
+31-655 files

FreeBSD/src aa3bbc0sys/netinet6 scope6.c scope6_var.h

netinet6: embed struct scope6_id into struct in6_ifextra

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54726
DeltaFile
+6-13sys/netinet6/scope6.c
+1-12sys/netinet6/scope6_var.h
+9-1sys/netinet6/in6_var.h
+1-1sys/netinet6/in6.c
+0-1sys/netinet6/in6_ifattach.c
+17-285 files

FreeBSD/src 576ee62sys/netinet6 nd6.c nd6_rtr.c

netinet6: store ND context directly in struct in6_ifextra

Stop using struct nd_ifinfo for that, because it is an API struct for
SIOCGIFINFO_IN6.  The functional changes are isolated to the protocol
attach and detach: in6_ifarrival(), nd6_ifattach(), in6_ifdeparture(),
nd6_ifdetach(), as well as to the nd6_ioctl(), nd6_ra_input(),
nd6_slowtimo() and in6_ifmtu().

The dad_failures member was just renamed to match the rest.  The M_IP6NDP
malloc(9) type declaration moved to files that actually use it.

The rest of the changes are mechanical substitution of double pointer
dereference via ND_IFINFO() to a single pointer dereference.  This was
achieved with a sed(1) script:

s/ND_IFINFO\(([a-z0-9>_.-]+)\)->(flags|linkmtu|basereachable|reachable|retrans|chlim)/\1->if_inet6->nd_\2/g
s/nd_chlim/nd_curhoplimit/g

Reviewed by:            tuexen, madpilot
Differential Revision:  https://reviews.freebsd.org/D54725
DeltaFile
+84-88sys/netinet6/nd6.c
+30-26sys/netinet6/nd6_rtr.c
+16-16sys/netinet6/in6.c
+13-11sys/netinet6/nd6_nbr.c
+12-3sys/netinet6/in6_var.h
+2-10sys/netinet6/nd6.h
+157-1548 files not shown
+177-17314 files

FreeBSD/src 25a11d9sys/netinet6 in6.c in6_rmx.c, sys/netpfil/pf pf.c

netinet6: use in6_ifmtu() instead of IN6_LINKMTU() macro

There should be no functional change.  If there are any performance
concerns with a function call, with the future changes, that would move
ND6 bits into in6_ifextra, this function would be easily inline-able.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54724
DeltaFile
+7-2sys/netinet6/in6.c
+2-4sys/netinet6/in6_rmx.c
+0-5sys/netinet6/nd6.h
+2-2sys/netpfil/pf/pf.c
+2-2sys/netinet6/ip6_forward.c
+2-2sys/netinet6/ip6_output.c
+15-173 files not shown
+18-209 files

FreeBSD/src 3182dc4sys/netinet icmp6.h, sys/netinet6 in6_var.h in6.c

netinet6: embed the counter(9) arrays in struct in6_ifextra

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54723
DeltaFile
+17-19sys/netinet6/in6_var.h
+0-6sys/netinet6/in6.c
+1-2sys/netinet/icmp6.h
+0-2sys/netinet6/in6_ifattach.c
+18-294 files

FreeBSD/src 6857b3asys/netinet6 nd6.h

netinet6: embed struct nd_ifinfo into struct in6_ndireq

There is no functional change here, but we'd like to emphasize that the
nd_ifinfo structure is not a actually a kernel ND6 software context,
despite being actively used like this way, but an API/ABI structure for
ioctl(2).  This should prevent from a ABI breakages like in 31ec8b6407fd.
This also is a step towards stopping using it as a kernel software
context.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D54722
DeltaFile
+22-18sys/netinet6/nd6.h
+22-181 files

FreeBSD/src 3aa8d53usr.bin/mkimg mkimg.1 mkimg.c

mkimg(1): Sync mkimg(1) and usage() with the implementation

Reviewed by:    imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54419
DeltaFile
+34-20usr.bin/mkimg/mkimg.1
+3-0usr.bin/mkimg/mkimg.c
+37-202 files

FreeBSD/src 37d11fdtests/sys/kern ssl_sendfile.c Makefile

tests/kern: add test for SSL_sendfile()
DeltaFile
+514-0tests/sys/kern/ssl_sendfile.c
+2-0tests/sys/kern/Makefile
+516-02 files

FreeBSD/src 4990cf8. MAINTAINERS

MAINTAINERS: Remove some stale entries

Remove some stale entries, preen some others. Longer term, we need a
better format. Also, if there's mistakes, let us know: we want it to be
useful to people seeking review, not be perscriptive about who can do
what.

Reviewed by: srcmgr@
DeltaFile
+14-22MAINTAINERS
+14-221 files

FreeBSD/src 3cdb6c9contrib/llvm-project/libcxx/include inttypes.h

libc++ inttypes.h: define __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS

Before transitively including the base version of inttypes.h, define
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS, because the base
inttypes.h directly includes sys/stdint.h, instead of going through the
'regular' stdint.h.

The libc++ version of the latter does define those macros, to ensure
things like UINT64_C() and SIZE_MAX are defined even in C++98 or C++03.

MFC after:      3 days
DeltaFile
+9-2contrib/llvm-project/libcxx/include/inttypes.h
+9-21 files

FreeBSD/src 6abefcdsys/dev/ahci ahci.c, sys/dev/mvs mvs.c

Fix SATA NCQ error recovery after 25375b1415

Since that commit ahci(4), siis(4) and mvs(4) drivers ended up
using wrong command to fetch error information for NCQ commands.
Since ATA errors are not very informative to begin with, the only
noticeable effect is a lack of retries on those errors by CAM.

MFC after:      1 week
PR:             279978

(cherry picked from commit 87085c12ba8fa51f777bc636df67008b45e20d1c)
DeltaFile
+1-1sys/dev/siis/siis.c
+1-1sys/dev/mvs/mvs.c
+1-1sys/dev/ahci/ahci.c
+3-33 files

FreeBSD/src 6c5fdbasys/arm/arm gic.c

arm/gic: Detect broken configurations

Some virtualization platforms provide broken configurations. There
is a GIC interrupt controller, however accessing the CPU interface
registers leads to an external data abort. As these are needed to
handle interrupts we are unable to boot further.

Detect this misconfiguration and panic to tell the user the issue.

Reviewed by:    emaste
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54832
DeltaFile
+14-1sys/arm/arm/gic.c
+14-11 files

FreeBSD/src e6bafbeshare/man/man4 capsicum.4

capsicum.4: Replace 'fi' ligature and smart quotation mark

While here, wrap the line to 80 characters.

Reviewed by:    jlduran
Fixes:          c54534e60263 ("capsicum.4: Add some more detail from the Capsicum paper")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54761
DeltaFile
+5-5share/man/man4/capsicum.4
+5-51 files