HardenedBSD/src 949c0cbsys/dev/pci pci_user.c, sys/fs/p9fs p9fs_vnops.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+386-106usr.sbin/pciconf/pciconf.c
+48-28usr.sbin/pciconf/pciconf.8
+25-27sys/kern/vfs_vnops.c
+43-7sys/fs/p9fs/p9fs_vnops.c
+31-1sys/dev/pci/pci_user.c
+6-6sys/sys/vnode.h
+539-1758 files not shown
+568-18914 files

HardenedBSD/src c655cc6share/man/man4 pci.4, sys/dev/pci pci_user.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+386-106usr.sbin/pciconf/pciconf.c
+48-28usr.sbin/pciconf/pciconf.8
+25-27sys/kern/vfs_vnops.c
+43-7sys/fs/p9fs/p9fs_vnops.c
+31-1sys/dev/pci/pci_user.c
+9-3share/man/man4/pci.4
+542-1728 files not shown
+568-18914 files

HardenedBSD/src ba7439fusr.bin/yes yes.c

yes: Add missing header

This is a no-op on FreeBSD due to namespace pollution.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Fixes:          cf74b63d61b4 ("yes: Completely overengineer")
DeltaFile
+1-0usr.bin/yes/yes.c
+1-01 files

HardenedBSD/src 14b8a27usr.sbin/pciconf pciconf.c pciconf.8

pciconf: Add a tree mode

This lists PCI devices in a hierarchy showing the parent/child
relationship of PCI devices and bridges.  While this is inspired by
lspci -t output, the format is closer to ps -d and also prefers using
new-bus device names when possible.  If a device does not have a
driver, the PCI selector is output in place of the device name.

When the -v flag is given, the vendor and device ID strings are output
after the device name.  If a string for an ID isn't found, the hex ID
values are output instead.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55774
DeltaFile
+252-2usr.sbin/pciconf/pciconf.c
+24-0usr.sbin/pciconf/pciconf.8
+276-22 files

HardenedBSD/src 98a0d22usr.sbin/pciconf pciconf.8

pciconf.8: Reorganize slightly to handle additional modes

Move the description of the optional device argument earlier before
describing individual command modes.

Add a subsection for list mode and a second subsection for the other
modes that work with a single device.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55773
DeltaFile
+27-31usr.sbin/pciconf/pciconf.8
+27-311 files

HardenedBSD/src 9a13949usr.sbin/pciconf pciconf.c

pciconf: Use the exported values of bus numbers for PCI bridges

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55772
DeltaFile
+4-8usr.sbin/pciconf/pciconf.c
+4-81 files

HardenedBSD/src 7e7a1b6share/man/man4 pci.4, sys/dev/pci pci_user.c pci.c

pci: Export bus numbers for bridge devices in struct pci_conf

This exports bus information about bridges to userspace via the
less-privileged PCIOCGETCONF ioctl.  Previously if userspace wished to
query this information, it had to use direct PCI config register
access which requires higher privilege.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55771
DeltaFile
+31-1sys/dev/pci/pci_user.c
+6-0share/man/man4/pci.4
+3-1sys/sys/pciio.h
+3-0sys/dev/pci/pci.c
+43-24 files

HardenedBSD/src c3ac5f1share/man/man4 pci.4

pci.4: Quote argument to -width for a list block

This fixes an mdoc warning and also properly indents this list.  While
here, update the quoted argument to be the longest tag in the list.

Also while here, correct the description of pd_numa_domain.  NUMA
domains are a property of the device, not of the driver.

Reviewed by:    ziaee, imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55770
DeltaFile
+3-3share/man/man4/pci.4
+3-31 files

HardenedBSD/src c8fb165usr.sbin/pciconf pciconf.c

pciconf: Use a single enum to track the current operation mode

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55769
DeltaFile
+38-28usr.sbin/pciconf/pciconf.c
+38-281 files

HardenedBSD/src 9eb035fusr.sbin/pciconf pciconf.c

pciconf: Factor out fetching of matching devices from list_devs

The new fetch_devs function fetches the entire list of PCI devices
into a single list, retrying if the list changes while it is being
fetched.

Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55768
DeltaFile
+96-72usr.sbin/pciconf/pciconf.c
+96-721 files

HardenedBSD/src c2012c7sys/fs/p9fs p9fs.h p9fs_vnops.c

p9fs: use atomics for updating node->flags

This should prevent seeing inconsistent flags values when updating it
under the shared vnode lock.

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55665
DeltaFile
+6-3sys/fs/p9fs/p9fs.h
+4-4sys/fs/p9fs/p9fs_vnops.c
+3-3sys/fs/p9fs/p9fs_vfsops.c
+13-103 files

HardenedBSD/src 2b256f0sys/fs/p9fs p9fs_vnops.c

p9fs: locking improvements for p9fs_stat_vnode_dotl()

If the vnode is share-locked:
- Use vn_delayed_setsize() to avoid calling vnode_pager_setsize() with
  the vnode only shared locked.
- Interlock the vnode to get exclusive mode for updating the node
  fields.

Reciprocally, interlock the vnode in p9fs_getattr_dotl() to observe the
consistent values on read.

PR:     293492
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55665
DeltaFile
+39-3sys/fs/p9fs/p9fs_vnops.c
+39-31 files

HardenedBSD/src 92d7808sys/fs/deadfs dead_vnops.c, sys/fs/nfsclient nfs_clport.c

vn_delayed_setsize(): post-commit review' changes

Handle doomed vnodes after LK_RETRY.
Rename the flag from VI_DELAYEDSSZ to VI_DELAYED_SETSIZE.
Change signature of vn_lock_delayed_setsize() to take flatten values
list instead of vop args structure.
__predict_true() for VI_DELAYED_SETSIZE not set.
Minor editings like removing tautological assert, and sorting items.

Noted by:       markj
Fixes:  45117ffcd533ddf995f654db60b10899ae8370ec
Reviewed by:    markj, rmacklem
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D55681
DeltaFile
+25-27sys/kern/vfs_vnops.c
+6-6sys/sys/vnode.h
+3-3sys/fs/deadfs/dead_vnops.c
+1-1sys/fs/nfsclient/nfs_clport.c
+35-374 files

HardenedBSD/src e8a256dusr.bin Makefile, usr.bin/yes yes.c yes.1

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+53-22usr.bin/yes/yes.c
+3-21usr.sbin/virtual_oss/virtual_oss/main.c
+4-2usr.bin/yes/yes.1
+1-1usr.bin/Makefile
+61-464 files

HardenedBSD/src 870af77usr.bin Makefile, usr.bin/yes yes.c yes.1

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+53-22usr.bin/yes/yes.c
+3-21usr.sbin/virtual_oss/virtual_oss/main.c
+4-2usr.bin/yes/yes.1
+1-1usr.bin/Makefile
+61-464 files

HardenedBSD/src 2bf8f0clib/libsys rename.2, sys/amd64/amd64 trap.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+65-26lib/libsys/rename.2
+7-74usr.sbin/mixer/mixer.c
+4-71usr.sbin/mixer/mixer.8
+42-15sys/amd64/amd64/trap.c
+35-14sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+33-7sys/kern/vfs_syscalls.c
+186-20742 files not shown
+443-24648 files

HardenedBSD/src b2ae957sys/compat/linux linux_file.c

linuxolator: translate LINUX_RENAME_NOREPLACE into our AT_RENAME_NOREPLACE

(cherry picked from commit 8feb8d221cfb842ee11d744d22571baec6c18cd8)
DeltaFile
+23-12sys/compat/linux/linux_file.c
+23-121 files

HardenedBSD/src 1bb58balib/libsys rename.2

libsys/rename.2: remove commented-out CAVEAT section

(cherry picked from commit 5f911eaba017645487a1eaee3609b26a77f0f174)
DeltaFile
+0-26lib/libsys/rename.2
+0-261 files

HardenedBSD/src b5e307dsys/compat/freebsd32 freebsd32_systrace_args.c freebsd32_syscall.h, sys/kern systrace_args.c

Regen
DeltaFile
+38-0sys/kern/systrace_args.c
+38-0sys/compat/freebsd32/freebsd32_systrace_args.c
+9-0sys/sys/sysproto.h
+2-1sys/sys/syscall.h
+2-1sys/compat/freebsd32/freebsd32_syscall.h
+2-1sys/sys/syscall.mk
+91-36 files not shown
+99-312 files

HardenedBSD/src 3ccc39dlib/libsys rename.2 Makefile.sys

renameat2(2): document

(cherry picked from commit 619e49b2ba58e1ffd2ab111fef6d1e87d77e7391)
DeltaFile
+65-0lib/libsys/rename.2
+2-1lib/libsys/Makefile.sys
+67-12 files

HardenedBSD/src 5061709sys/amd64/amd64 trap.c

amd64: print userspace fsbase and gsbase for uprintf_signal

(cherry picked from commit 272ea451199462dffd55dd580532eb28ddc92174)
DeltaFile
+19-2sys/amd64/amd64/trap.c
+19-21 files

HardenedBSD/src 9c37c82sys/fs/msdosfs msdosfs_vnops.c, sys/fs/tmpfs tmpfs_vnops.c

renameat2(2): implement AT_RENAME_NOREPLACE flag

(cherry picked from commit 7aaec5f3faecf98e377c97e24dddb9c65f4b2e75)
DeltaFile
+20-4sys/kern/vfs_syscalls.c
+7-2sys/fs/tmpfs/tmpfs_vnops.c
+7-2sys/fs/msdosfs/msdosfs_vnops.c
+6-1sys/ufs/ufs/ufs_vnops.c
+3-0sys/sys/fcntl.h
+43-95 files

HardenedBSD/src 522dbebinclude stdio.h, lib/libsys Symbol.sys.map

sys: add renameat2(2) syscall

(cherry picked from commit 28599a1e5f1b90676a818e0a4818cddd0839ad25)
DeltaFile
+10-0sys/kern/vfs_syscalls.c
+9-1sys/kern/syscalls.master
+1-0include/stdio.h
+1-0lib/libsys/Symbol.sys.map
+21-14 files

HardenedBSD/src bbdf045sys/compat/linux linux_file.c, sys/kern vfs_syscalls.c

kern_renameat(9): add flags argument

(cherry picked from commit 1f3020067ab3f3c5043d01ea1e3a3d2998a39d4a)
DeltaFile
+4-4sys/kern/vfs_syscalls.c
+2-2sys/compat/linux/linux_file.c
+1-1sys/sys/syscallsubr.h
+7-73 files

HardenedBSD/src 45401a4sys/fs/msdosfs msdosfs_vnops.c, sys/fs/nfsclient nfs_clvnops.c

VOP_RENAME(9): add flags argument

(cherry picked from commit e486066cf48a89ba87fab6b3d2b56f271f50439b)
DeltaFile
+7-0sys/ufs/ufs/ufs_vnops.c
+6-1sys/fs/unionfs/union_vnops.c
+6-0sys/fs/nfsclient/nfs_clvnops.c
+5-0sys/fs/msdosfs/msdosfs_vnops.c
+5-0sys/fs/p9fs/p9fs_vnops.c
+5-0sys/fs/smbfs/smbfs_vnops.c
+34-17 files not shown
+51-413 files

HardenedBSD/src 72cf8b9sys/contrib/openzfs/include/os/freebsd/zfs/sys zfs_vnops_os.h, sys/contrib/openzfs/module/os/freebsd/zfs zfs_vnops_os.c

zfs: implement AT_RENAME_NOREPLACE

(cherry picked from commit 7a1217ff3bbdd1ef40d1b94170c53611fadeb026)
DeltaFile
+17-8sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+2-2sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vnops_os.h
+1-1sys/contrib/openzfs/module/zfs/zfs_replay.c
+20-113 files

HardenedBSD/src 0b0bbdasys/contrib/openzfs/module/os/freebsd/zfs zfs_vnops_os.c

zfs rename: properly cleanup on errors occuring before zfs_do_rename()

(cherry picked from commit ed87040311b88e2c95a791aa049f2c37c857f048)
DeltaFile
+16-7sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+16-71 files

HardenedBSD/src ade7375sys/amd64/amd64 efirt_support.S

amd64: align stack on 16 bytes when calling into a EFIRT method

(cherry picked from commit 347cec10e25eacb2906a0a8105eff036850db766)
DeltaFile
+1-0sys/amd64/amd64/efirt_support.S
+1-01 files

HardenedBSD/src b0ca929sys/amd64/amd64 apic_vector.S, sys/i386/i386 mp_machdep.c apic_vector.S

x86: change signatures of ipi_{bitmap,swi}_handler() to take pointer

(cherry picked from commit fdc1f34506346fd26db8bfb80ba69d1af844c53a)
DeltaFile
+14-0sys/i386/i386/mp_machdep.c
+5-5sys/x86/x86/mp_x86.c
+2-2sys/x86/include/x86_smp.h
+2-2sys/i386/i386/apic_vector.S
+2-2sys/x86/xen/xen_apic.c
+2-0sys/amd64/amd64/apic_vector.S
+27-116 files

HardenedBSD/src ab2b871sys/amd64/amd64 trap.c

amd64: extract uprintf_signal printing into a helper

(cherry picked from commit 3e8a9995e9541a0bdd707f111e51ef46a544ee3e)
DeltaFile
+25-15sys/amd64/amd64/trap.c
+25-151 files