HardenedBSD/src 37183a4sys/compat/linuxkpi/common/include/linux seq_buf.h bitops.h, sys/compat/linuxkpi/common/src linux_seq_buf.c linux_pci.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+73-0sys/compat/linuxkpi/common/include/linux/seq_buf.h
+64-0sys/compat/linuxkpi/common/src/linux_seq_buf.c
+36-0sys/compat/linuxkpi/common/src/linux_pci.c
+6-6sys/compat/linuxkpi/common/include/linux/bitops.h
+9-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+4-5tools/tools/nanobsd/defaults.sh
+192-118 files not shown
+207-1214 files

HardenedBSD/src 48052cesys/dev/clk/rockchip rk_clk_fract.c, sys/netpfil/ipfw ip_fw_table_value.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+1-1sys/dev/clk/rockchip/rk_clk_fract.c
+1-1sys/netpfil/ipfw/ip_fw_table_value.c
+2-22 files

HardenedBSD/src 60e75e9sys/netpfil/ipfw ip_fw_table_value.c

netpfil/ipfw: Fix a typo in a source code comment

- s/vaues/values/

(cherry picked from commit 9be9ab2a242080dea6254e187cf211604170de07)
DeltaFile
+1-1sys/netpfil/ipfw/ip_fw_table_value.c
+1-11 files

HardenedBSD/src ad9c5a6sys/dev/clk/rockchip rk_clk_fract.c

rockship: Fix a typo in a source code comment

- s/vaues/values/

(cherry picked from commit cabb5add07a60c146698d09759445276aa96757a)
DeltaFile
+1-1sys/dev/clk/rockchip/rk_clk_fract.c
+1-11 files

HardenedBSD/src 58580dclib/libc/gen posix_spawnattr_getexecfd_np.3 Makefile.inc

libc: document posix_spawnattr_getexecfd_np(3)

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54862
DeltaFile
+86-0lib/libc/gen/posix_spawnattr_getexecfd_np.3
+2-0lib/libc/gen/Makefile.inc
+2-0lib/libc/gen/posix_spawn.3
+90-03 files

HardenedBSD/src 3f0aea0include spawn.h, lib/libc/gen posix_spawn.c Symbol.map

libc: add posix_spawnattr_{get,set}execfd_np(3)

If execfd is set, the fexecve(2) is used by posix_spawn() instead of the
provided path.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54862
DeltaFile
+21-1lib/libc/gen/posix_spawn.c
+7-0include/spawn.h
+5-0lib/libc/gen/Symbol.map
+33-13 files

HardenedBSD/src 45658a7release/tools vmimage.subr

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-4release/tools/vmimage.subr
+0-41 files

HardenedBSD/src fbcb045sys/compat/linuxkpi/common/include/linux seq_buf.h bitops.h, sys/compat/linuxkpi/common/src linux_seq_buf.c linux_pci.c

Merge remote-tracking branch 'internal/freebsd/current/main' into hardened/current/master

Conflicts:
        release/tools/vmimage.subr (unresolved)
DeltaFile
+73-0sys/compat/linuxkpi/common/include/linux/seq_buf.h
+64-0sys/compat/linuxkpi/common/src/linux_seq_buf.c
+36-0sys/compat/linuxkpi/common/src/linux_pci.c
+6-6sys/compat/linuxkpi/common/include/linux/bitops.h
+4-5tools/tools/nanobsd/defaults.sh
+9-0sys/compat/linuxkpi/common/include/linux/dma-mapping.h
+192-118 files not shown
+211-1214 files

HardenedBSD/src a200c8esys/compat/linuxkpi/common/include/linux eventfd.h, sys/compat/linuxkpi/common/src linux_eventfd.c

linuxkpi: Add eventfd_*()

Add <linux/eventfd.h> and expose the `eventfd_*()` API. This is used by
DRM drivers for some time, but the code was commented out so far.

Note that Linux uses `struct eventfd_ctx`, but FreeBSD defines `struct
eventfd`. We define `eventfd_ctx` as a synonym to `eventfd`.

Reviewed by:    christos, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50853
DeltaFile
+63-0sys/compat/linuxkpi/common/src/linux_eventfd.c
+54-0sys/compat/linuxkpi/common/include/linux/eventfd.h
+2-0sys/conf/files
+1-0sys/modules/linuxkpi/Makefile
+0-0sys/compat/linuxkpi/dummy/include/linux/eventfd.h
+120-05 files

HardenedBSD/src 28d6ffesys/kern sys_eventfd.c, sys/sys eventfd.h

eventfd: Add eventfd_signal()

The `eventfd_signal()` function is the equivalent to a write to an
eventfd file descriptor: it bumps the internal counter and wakes up
processes waiting for it.

`eventfd_signal()` is meant to be used by kernel drivers. DRM drivers
will call it through linuxkpi.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50850
DeltaFile
+22-3sys/kern/sys_eventfd.c
+1-0sys/sys/eventfd.h
+23-32 files

HardenedBSD/src d185e9fsys/sys param.h

Bump __FreeBSD_version to 1600011 after changes to eventfd

This covers the commits that updated the API and the commit that exposes
that API in linuxkpi for DRM drivers.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/sys/param.h
+1-11 files

HardenedBSD/src 5931649sys/kern sys_eventfd.c, sys/sys eventfd.h

eventfd: Add refcounting

An eventfd file descriptor can be used by drivers such as DRM drivers
through linuxkpi. A driver can hold a reference to such a file
regardless of the fact it is used by userland or not.

This patch introduces a refcount in `struct eventfd`, plus the
`eventfd_get()` and `eventfd_put()` functions to acquire and release
references. These functions will be used by DRM drivers for instance.

This structure is internal to `sys/kern/sys_eventfd.c` and not used
anywhere else. Thus it is safe to add a field without breaking anything.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50849
DeltaFile
+30-4sys/kern/sys_eventfd.c
+4-0sys/sys/eventfd.h
+34-42 files

HardenedBSD/src e878df0lib/libsys syscalls.map, sys/compat/freebsd32 freebsd32_systrace_args.c freebsd32_proto.h

Regen syscall tables after pdfork(2) and pdwait(2) additions
DeltaFile
+68-0sys/kern/systrace_args.c
+68-0sys/compat/freebsd32/freebsd32_systrace_args.c
+16-0sys/sys/sysproto.h
+9-0sys/compat/freebsd32/freebsd32_proto.h
+4-0lib/libsys/syscalls.map
+3-1sys/sys/syscall.h
+168-17 files not shown
+186-313 files

HardenedBSD/src 6c82bf1lib/libc/gen exterr_cat_filenames.h

Regen for the fork and exit/wait exterror category addition
DeltaFile
+2-0lib/libc/gen/exterr_cat_filenames.h
+2-01 files

HardenedBSD/src ec8e8fashare/man/man4 rights.4

rights.4: document CAP_PDWAIT

Noted by:       markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+3-0share/man/man4/rights.4
+3-01 files

HardenedBSD/src f7b5688lib/libsys pdfork.2 Makefile.sys

Document pdrfork(2) and pdwait(2)

Reviewed by:    asomers, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+81-8lib/libsys/pdfork.2
+4-2lib/libsys/Makefile.sys
+1-0lib/libsys/rfork.2
+1-0lib/libsys/wait.2
+87-104 files

HardenedBSD/src 2d555eclib/libc/sys pdwait.c Symbol.map, lib/libsys interposing_table.c Makefile.sys

lib/libsys, lib/libc: export pdwait

Make pdwait(2) cancellable, same as all other wait*(2) syscalls wrappers.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+20-0lib/libc/sys/pdwait.c
+15-0lib/libthr/thread/thr_syscalls.c
+4-0sys/sys/procdesc.h
+4-0lib/libc/sys/Symbol.map
+1-0lib/libsys/interposing_table.c
+1-0lib/libsys/Makefile.sys
+45-01 files not shown
+46-07 files

HardenedBSD/src 4d70782sys/compat/freebsd32 freebsd32_misc.c, sys/kern kern_exit.c syscalls.master

Add pdwait(2)

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+105-0sys/kern/kern_exit.c
+31-0sys/compat/freebsd32/freebsd32_misc.c
+10-0sys/kern/syscalls.master
+4-0sys/kern/sys_procdesc.c
+2-0sys/sys/syscallsubr.h
+152-05 files

HardenedBSD/src 0998487sys/kern kern_exit.c sys_procdesc.c

procdesc: postpone freeing the zombie' pid until procdesc is freed

Requested by:   asomers
Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+2-2sys/kern/kern_exit.c
+4-0sys/kern/sys_procdesc.c
+6-22 files

HardenedBSD/src aa72df7sys/kern subr_capability.c, sys/sys caprights.h

sys: Add cap_pdwait_rights

Suggested by:   asomers
Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+1-0sys/kern/subr_capability.c
+1-0sys/sys/caprights.h
+2-02 files

HardenedBSD/src a560abesys/security/audit audit_bsm.c

audit: handle AUE_PDWAIT

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+10-0sys/security/audit/audit_bsm.c
+10-01 files

HardenedBSD/src 7fe33d5sys/kern kern_exit.c

kern/kern_exit.c: extract wait6_check_alive() helper

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+59-37sys/kern/kern_exit.c
+59-371 files

HardenedBSD/src 2b67cfasys/kern kern_exit.c

kern/kern_exit.c: extract some helpers from proc_to_reap()

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+66-50sys/kern/kern_exit.c
+66-501 files

HardenedBSD/src 109b9f4sys/kern kern_exit.c, sys/sys exterr_cat.h

kern/kern_exit.c: define the exterror category for exit/wait

Convert EINVALs in kern_exit.c into EXTERRORs.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+25-14sys/kern/kern_exit.c
+1-0sys/sys/exterr_cat.h
+26-142 files

HardenedBSD/src f10b4b6lib/libsys Symbol.sys.map, sys/sys procdesc.h

lib/libsys, lib/libc: export pdrfork(2)

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+4-0lib/libsys/Symbol.sys.map
+1-0sys/sys/procdesc.h
+5-02 files

HardenedBSD/src 5c2ee61sys/kern kern_fork.c syscalls.master

sys: add pdrfork(2)

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+42-0sys/kern/kern_fork.c
+9-0sys/kern/syscalls.master
+51-02 files

HardenedBSD/src d0d4b9bsys/bsm audit_kevents.h, sys/security/audit audit_bsm.c

sys: add AUE_PDRFORK

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+18-0sys/security/audit/audit_bsm.c
+1-0sys/bsm/audit_kevents.h
+19-02 files

HardenedBSD/src 7211cd2sys/kern kern_fork.c, sys/sys exterr_cat.h

kern/kern_fork.c: define the exterror category for fork

Convert EINVALs in kern_fork.c into EXTERRORs.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+18-17sys/kern/kern_fork.c
+1-0sys/sys/exterr_cat.h
+19-172 files

HardenedBSD/src 472c32asys/kern kern_exit.c kern_fork.c

kern/kern_fork/exit.c: organize includes

Remove sys/cdefs.h.
Remove sys/param.h.
Order the sys/*.h includes alphabetically.

Reviewed by:    asomers, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+15-17sys/kern/kern_exit.c
+8-10sys/kern/kern_fork.c
+23-272 files

HardenedBSD/src f5acbacsys/kern kern_exit.c

kern/kern_exit.c: some style

Reviewed by:    asomers, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54592
DeltaFile
+11-12sys/kern/kern_exit.c
+11-121 files