HardenedBSD/src ded4006lib/libnv/tests nvlist_send_recv_test.c nv_array_tests.cc, sys/cam/ctl ctl.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+226-0tests/sys/cam/ctl/read_buffer.sh
+193-0lib/libnv/tests/nvlist_send_recv_test.c
+92-49sys/kern/kern_umtx.c
+56-2lib/libnv/tests/nv_array_tests.cc
+20-18sys/cam/ctl/ctl.c
+13-9sys/contrib/libnv/bsd_nvpair.c
+600-7820 files not shown
+683-11626 files

HardenedBSD/src b8961c2lib/libnv/tests nvlist_send_recv_test.c nv_array_tests.cc, sys/cam/ctl ctl.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+226-0tests/sys/cam/ctl/read_buffer.sh
+193-0lib/libnv/tests/nvlist_send_recv_test.c
+92-49sys/kern/kern_umtx.c
+56-2lib/libnv/tests/nv_array_tests.cc
+20-18sys/cam/ctl/ctl.c
+13-9sys/contrib/libnv/bsd_nvpair.c
+600-7820 files not shown
+683-11626 files

HardenedBSD/src 9c5dc64sys/cam/ctl ctl.c, sys/contrib/libnv bsd_nvpair.c nvlist.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+226-0tests/sys/cam/ctl/read_buffer.sh
+92-49sys/kern/kern_umtx.c
+20-18sys/cam/ctl/ctl.c
+13-9sys/contrib/libnv/bsd_nvpair.c
+10-0tests/sys/cam/ctl/Makefile
+6-2sys/contrib/libnv/nvlist.c
+367-786 files not shown
+391-8212 files

HardenedBSD/src 7783c12sys/cam/ctl ctl.c, sys/contrib/libnv bsd_nvpair.c

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+226-0tests/sys/cam/ctl/read_buffer.sh
+92-49sys/kern/kern_umtx.c
+49-13sys/netgraph/ng_ksocket.c
+20-18sys/cam/ctl/ctl.c
+13-9sys/contrib/libnv/bsd_nvpair.c
+10-0tests/sys/cam/ctl/Makefile
+410-897 files not shown
+441-9613 files

HardenedBSD/src 9c2ef10sys/contrib/libnv bsd_nvpair.c

libnv: verify that string is null terminated

During unpacking, we ensure that we do not read beyond the
declared size. However, unpack uses a function that copies
null-terminated strings. Prior to this commit, if the last string
was not null-terminated, it could result in copying data into a
buffer smaller than the allocated size.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45288
Security:       CAP-03
Reported by:    Synacktiv
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46138

(cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae)
DeltaFile
+4-0sys/contrib/libnv/bsd_nvpair.c
+4-01 files

HardenedBSD/src 371af89sys/contrib/libnv bsd_nvpair.c nvlist.c

libnv: allocate buffer in a safe way

Ensure that the calculation of size of array doesn't
overflow.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45287
Security:       CAP-02
Reported by:    Synacktiv
Reported by:    Taylor R Campbell (NetBSD)
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46131

(cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071)
DeltaFile
+9-9sys/contrib/libnv/bsd_nvpair.c
+6-2sys/contrib/libnv/nvlist.c
+15-112 files

HardenedBSD/src 03bef99sys/contrib/libnv bsd_nvpair.c

libnv: verify that string is null terminated

During unpacking, we ensure that we do not read beyond the
declared size. However, unpack uses a function that copies
null-terminated strings. Prior to this commit, if the last string
was not null-terminated, it could result in copying data into a
buffer smaller than the allocated size.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45288
Security:       CAP-03
Reported by:    Synacktiv
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46138

(cherry picked from commit 3aaaca1b51ad844ef9e9b3d945217ab3dd189bae)
DeltaFile
+4-0sys/contrib/libnv/bsd_nvpair.c
+4-01 files

HardenedBSD/src 2e7f924sys/contrib/libnv bsd_nvpair.c nvlist.c

libnv: allocate buffer in a safe way

Ensure that the calculation of size of array doesn't
overflow.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45287
Security:       CAP-02
Reported by:    Synacktiv
Reported by:    Taylor R Campbell (NetBSD)
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46131

(cherry picked from commit 36fa90dbde0060aacb5677d0b113ee168e839071)
DeltaFile
+9-9sys/contrib/libnv/bsd_nvpair.c
+6-2sys/contrib/libnv/nvlist.c
+15-112 files

HardenedBSD/src 3aaaca1sys/contrib/libnv bsd_nvpair.c

libnv: verify that string is null terminated

During unpacking, we ensure that we do not read beyond the
declared size. However, unpack uses a function that copies
null-terminated strings. Prior to this commit, if the last string
was not null-terminated, it could result in copying data into a
buffer smaller than the allocated size.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45288
Security:       CAP-03
Reported by:    Synacktiv
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46138
DeltaFile
+4-0sys/contrib/libnv/bsd_nvpair.c
+4-01 files

HardenedBSD/src 36fa90dsys/contrib/libnv bsd_nvpair.c nvlist.c

libnv: allocate buffer in a safe way

Ensure that the calculation of size of array doesn't
overflow.

Security:       FreeBSD-24:09.libnv
Security:       CVE-2024-45287
Security:       CAP-02
Reported by:    Synacktiv
Reported by:    Taylor R Campbell (NetBSD)
Sponsored by:   The Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46131
DeltaFile
+9-9sys/contrib/libnv/bsd_nvpair.c
+6-2sys/contrib/libnv/nvlist.c
+15-112 files

HardenedBSD/src 65b43f4bin/cp/tests cp_test.sh, bin/pkill pkill.c

Merge remote-tracking branch 'freebsd/stable/13' into hardened/13-stable/master

Conflicts:
        sys/i386/linux/imgact_linux.c (deleted)
        sys/kern/imgact_aout.c (deleted)
DeltaFile
+1-3sys/xen/xenbus/xenbusb.h
+1-3sys/dev/qlxge/qls_isr.c
+1-1sys/sys/_bus_dma.h
+1-1bin/cp/tests/cp_test.sh
+1-1bin/pkill/pkill.c
+1-1bin/timeout/timeout.1
+6-105,655 files not shown
+5,661-5,6655,661 files

HardenedBSD/src caa41f6sys/dev/qlxge qls_isr.c, sys/netgraph/bluetooth/l2cap ng_l2cap_ulpi.c

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:         pfg
MFC After:              3 days
Sponsored by:           Netflix

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
DeltaFile
+2-2sys/xen/xenbus/xenbusb.h
+2-2sys/dev/qlxge/qls_isr.c
+1-1sys/powerpc/include/openpicvar.h
+1-1sys/powerpc/include/pcpu.h
+1-1sys/powerpc/include/pcpu_aux.h
+1-1sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c
+8-85,432 files not shown
+5,440-5,4405,438 files

HardenedBSD/src 161fa17sys/contrib/dev/athk/ath11k mac.c wmi.c

Merge remote-tracking branch 'internal/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/man/man5/src.conf.5 (unresolved)
DeltaFile
+8,669-0sys/contrib/dev/athk/ath11k/mac.c
+8,286-0sys/contrib/dev/athk/ath11k/wmi.c
+5,662-0sys/contrib/dev/athk/ath11k/dp_rx.c
+5,585-0sys/contrib/dev/athk/ath11k/wmi.h
+4,704-0sys/contrib/dev/athk/ath11k/debugfs_htt_stats.c
+3,063-0sys/contrib/dev/athk/ath11k/qmi.c
+35,969-06,232 files not shown
+89,418-15,4896,238 files

HardenedBSD/src 8b901f3contrib/xz ChangeLog, contrib/xz/src/liblzma/common memcmplen.h

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

Conflicts:
        lib/csu/common/csu_common.h (deleted)
        share/man/man5/src.conf.5 (unresolved)
        sys/i386/linux/imgact_linux.c (deleted)
        sys/kern/imgact_aout.c (deleted)
DeltaFile
+267-0contrib/xz/ChangeLog
+66-0share/mk/local.sys.dirdeps.env.mk
+0-66share/mk/local.meta.sys.env.mk
+17-0stand/efi/libefi/devpath.c
+14-0tools/build/options/WITH_META_ERROR_TARGET
+12-1contrib/xz/src/liblzma/common/memcmplen.h
+376-675,795 files not shown
+6,208-5,8965,801 files

HardenedBSD/src 4d846d2sys/dev/adb adb_kbd.c adbvar.h, sys/dev/ae if_ae.c if_aereg.h

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:         pfg
MFC After:              3 days
Sponsored by:           Netflix
DeltaFile
+2-2sys/xen/xenbus/xenbusb.h
+2-2sys/dev/qlxge/qls_isr.c
+1-1sys/dev/adb/adb_kbd.c
+1-1sys/dev/adb/adbvar.h
+1-1sys/dev/ae/if_ae.c
+1-1sys/dev/ae/if_aereg.h
+8-85,571 files not shown
+5,579-5,5795,577 files

HardenedBSD/src 31367a1contrib/sqlite3 sqlite3.c, share/colldef_unicode zh_CN.UTF-8.src

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/man/man5/src.conf.5 (unresolved)
DeltaFile
+40,646-40,658share/colldef_unicode/zh_CN.UTF-8.src
+46,300-0sys/contrib/dev/rtw88/rtw8822c_table.c
+0-27,824sys/contrib/openzfs/module/zstd/lib/zstd.c
+22,204-0sys/contrib/dev/rtw88/rtw8822b_table.c
+9,441-436sys/contrib/zlib/crc32.h
+5,931-3,922contrib/sqlite3/sqlite3.c
+124,522-72,84014,231 files not shown
+826,315-442,38114,237 files

HardenedBSD/src ef95ebcsys/dev/drm2 drm_modes.c, sys/dev/xdma/controller pl330.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+25-12sys/netinet/sctp_sysctl.c
+18-13sys/netinet/tcp_subr.c
+3-19sys/dev/drm2/drm_modes.c
+16-2sys/netgraph/netflow/ng_netflow.c
+0-17sys/dev/xdma/controller/pl330.c
+5-5sys/riscv/riscv/sbi.c
+67-6895 files not shown
+223-262101 files

HardenedBSD/src 3fbf4casys/contrib/libnv bsd_nvpair.c

libnv: Mark a variable only used in a custom assertion as unused.
DeltaFile
+1-1sys/contrib/libnv/bsd_nvpair.c
+1-11 files

HardenedBSD/src ae98aa7contrib/wpa/src/common dpp.c, contrib/wpa/src/drivers driver_nl80211.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        share/mk/src.opts.mk (unresolved)
DeltaFile
+12,856-8,859crypto/openssh/ChangeLog
+12,229-0contrib/wpa/src/drivers/driver_nl80211.c
+1,597-7,228contrib/wpa/src/common/dpp.c
+3,269-4,509sys/contrib/openzfs/lib/libzfs/libzfs.abi
+2,349-2,973sys/contrib/openzfs/lib/libzfs_core/libzfs_core.abi
+2,298-2,547sys/contrib/openzfs/lib/libnvpair/libnvpair.abi
+34,598-26,1162,545 files not shown
+179,297-74,1452,551 files

HardenedBSD/src 6482c11sys/amd64/acpica acpi_wakeup.c, sys/dev/cxgbe/cxgbei icl_cxgbei.c

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master
DeltaFile
+0-494sys/x86/acpica/acpi_wakeup.c
+449-0sys/amd64/acpica/acpi_wakeup.c
+391-0sys/i386/acpica/acpi_wakeup.c
+126-80sys/dev/ixl/i40e_common.c
+56-42sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+63-8sys/dev/ixl/i40e_adminq_cmd.h
+1,085-62417 files not shown
+1,163-65323 files

HardenedBSD/src e673ac3sys/contrib/libnv bsd_nvpair.c

libnv: Fix array unpack endianness logic

When a nvlist(9) is converted into a binary buffer by nvlist_pack(9),
the host endianness is encoded in the nvlist_header of the binary
buffer. The nvlist_unpack(9) function converts a given binary buffer
to an nvlist. In the conversion process the endianness encoded in the
nvlist_header is evaluated and -- should the encoded endianness differ
from the endianess of the decoding host -- endianness conversion is
applied to nvlist_header and nvpair_header elements as well as
to some nvpair values.

In 2015 @oshogbo extended libnv with array support (in 347a39b).
The unpacking code misses the possible need to convert the endianness
of the nvph_nitems element of nvpair_headers.

The patch (re)enables libnv to unpack nvlists regardless of the
endianness of the packing host.

Pull Request:   https://github.com/freebsd/freebsd-src/pull/528
DeltaFile
+2-0sys/contrib/libnv/bsd_nvpair.c
+2-01 files

HardenedBSD/src 4c79391sys/contrib/libnv bsd_nvpair.c

libnv: fix double free

In r343986 we introduced a double free. The structure was already
freed fixed in the r302966. This problem was introduced
because the GitHub version was out of sync with the FreeBSD one.

Submitted by:   Mindaugas Rasiukevicius <rmind at netbsd.org>
MFC with:       r343986

(cherry picked from commit d97753b5c8f1d32fbcdcbb0d129b49f808245865)
DeltaFile
+0-8sys/contrib/libnv/bsd_nvpair.c
+0-81 files

HardenedBSD/src b907e9dsys/contrib/libnv bsd_nvpair.c

libnv: fix revert

Reported by:    jenkins

(cherry picked from commit 3bea7b5b05f200df4cabee12e405b8feade16f0e)
DeltaFile
+2-2sys/contrib/libnv/bsd_nvpair.c
+2-21 files

HardenedBSD/src f98545csys/contrib/libnv bsd_nvpair.c

libnv: fix memory leaks

nvpair_create_stringv: free the temporary string; this fix affects
nvlist_add_stringf() and nvlist_add_stringv().

nvpair_remove_nvlist_array (NV_TYPE_NVLIST_ARRAY case): free the chain
of nvpairs (as resetting it prevents nvlist_destroy() from freeing it).
Note: freeing the chain in nvlist_destroy() is not sufficient, because
it would still leak through nvlist_take_nvlist_array().  This affects
all nvlist_*_nvlist_array() use

Submitted by:   Mindaugas Rasiukevicius <rmind at netbsd.org>
Reported by:    clang/gcc ASAN
MFC after:      2 weeks

(cherry picked from commit b5d787d93b3d83f28e87e1f8cc740cb160f8f0ac)
DeltaFile
+10-2sys/contrib/libnv/bsd_nvpair.c
+10-21 files

HardenedBSD/src c7ce6b0contrib/libstdc++ configure, lib/clang/liblldb LLDBWrapLua.cpp

Merge branch 'hardened/current/master' into hardened/current/uninit-autoinit
DeltaFile
+0-111,817contrib/libstdc++/configure
+72,183-0lib/clang/liblldb/LLDBWrapLua.cpp
+71,590-432tools/tools/locale/etc/final-maps/widths.txt
+31,726-39,305share/ctypedef/ja_JP.eucJP.src
+59,521-0sys/contrib/dev/iwm/iwm-9000-34.fw.uu
+59,517-0sys/contrib/dev/iwm/iwm-9260-34.fw.uu
+294,537-151,55460,534 files not shown
+10,288,584-10,879,88160,540 files

HardenedBSD/src dd034b6contrib/sqlite3 sqlite3.c, contrib/subversion/subversion/libsvn_subr/utf8proc utf8proc_data.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi

Conflicts:
        Makefile.inc1 (unresolved)
        lib/csu/amd64/Makefile (unresolved)
        lib/csu/i386/Makefile (unresolved)
        share/man/man5/src.conf.5 (unresolved)
DeltaFile
+31,726-39,305share/ctypedef/ja_JP.eucJP.src
+11,659-6,934contrib/sqlite3/sqlite3.c
+7,544-7,544contrib/subversion/subversion/libsvn_subr/utf8proc/utf8proc_data.c
+9,480-0sys/dev/ice/ice_hw_autogen.h
+8,000-0sys/dev/ice/ice_lib.c
+5,910-1,341sys/netinet/tcp_stacks/rack.c
+74,319-55,1245,522 files not shown
+530,662-214,3455,528 files

HardenedBSD/src 3d27f9fsys/cddl/contrib/opensolaris/uts/common/dtrace dtrace.c, sys/contrib/libnv bsd_nvpair.c nvpair.c

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master:
  [ath_hal] Add KeyMiss for AR5212/AR5416 series chips.
  vm_page_free_prep(): correct description of the required page and object state.
  Fix libnv build post rename
  Fix "current" variable name conflict with openzfs
  Rename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version.
  Chroot first appeared in 4.3-Reno, not in 4.4 in the BSD world, but in System III in the AT&T world.
  Chroot actually appeared in 7th Edition Unix.
DeltaFile
+2,135-0sys/contrib/libnv/bsd_nvpair.c
+0-2,135sys/contrib/libnv/nvpair.c
+39-39sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
+4-2usr.sbin/chroot/chroot.8
+3-2sys/vm/vm_page.c
+3-2sys/dev/ath/ath_hal/ar5416/ar5416_recv.c
+2,184-2,1804 files not shown
+2,190-2,18510 files

HardenedBSD/src 56e5ad5 (r362666)sys/conf files, sys/contrib/libnv bsd_nvpair.c nvpair.c

Rename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version.
DeltaFile
+2,135-0sys/contrib/libnv/bsd_nvpair.c
+0-2,135sys/contrib/libnv/nvpair.c
+1-1sys/conf/files
+2,136-2,1363 files

HardenedBSD/src 31ee5afsys/conf files, sys/contrib/libnv nvpair.c bsd_nvpair.c

Rename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version.
DeltaFile
+0-2,135sys/contrib/libnv/nvpair.c
+2,135-0sys/contrib/libnv/bsd_nvpair.c
+1-1sys/conf/files
+2,136-2,1363 files