HardenedBSD/src 9874e4csys/dev/ixgbe ixgbe_type_e610.h ixgbe_e610.c, sys/netinet6 nd6_nbr.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+43-14sys/dev/ixgbe/ixgbe_type_e610.h
+35-13sys/dev/ixgbe/ixgbe_e610.c
+34-0sys/dev/ixgbe/if_ix.c
+12-10sys/netinet6/nd6_nbr.c
+4-1sys/sys/elf_common.h
+128-385 files

HardenedBSD/src 35b1dc2sys/dev/ixgbe ixgbe_type_e610.h ixgbe_e610.c, sys/netinet6 nd6_nbr.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+43-14sys/dev/ixgbe/ixgbe_type_e610.h
+35-13sys/dev/ixgbe/ixgbe_e610.c
+34-0sys/dev/ixgbe/if_ix.c
+12-10sys/netinet6/nd6_nbr.c
+4-1sys/sys/elf_common.h
+128-385 files

HardenedBSD/src d44a333contrib/jemalloc/src jemalloc.c, libexec/rc/rc.d virtual_oss

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+3-0contrib/jemalloc/src/jemalloc.c
+1-1libexec/rc/rc.d/virtual_oss
+4-12 files

HardenedBSD/src 6388835libexec/rc/rc.d virtual_oss

rc: virtual_oss: Silence potential hw.snd.default_unit error

PR:             293582
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit e85f221def717660c9daf4c0616dfb9cdfb75827)
DeltaFile
+1-1libexec/rc/rc.d/virtual_oss
+1-11 files

HardenedBSD/src 13ee84csys/dev/ixgbe ixgbe_type_e610.h ixgbe_e610.c

ix(4): Add EEE support for E610 adapters

The ix driver now supports Energy Efficient Ethernet (EEE) on Intel
E610 devices. EEE allows the network interface to enter low-power
states during periods of low link utilization, reducing power
consumption while maintaining full performance when needed.

E610 adapters provide EEE support through BASE-T PHY functionality.
Due to this PHY-based implementation, EEE is supported only
on 2.5Gb speeds and above.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale at intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Authored-by: Yogesh Bhosale <yogesh.bhosale at intel.com>

Approved by:    kbowling (mentor)
Tested by:      Mateusz Moga <mateusz.moga at intel.com>
MFC after:      2 weeks

    [2 lines not shown]
DeltaFile
+43-14sys/dev/ixgbe/ixgbe_type_e610.h
+35-13sys/dev/ixgbe/ixgbe_e610.c
+34-0sys/dev/ixgbe/if_ix.c
+112-273 files

HardenedBSD/src 75f1665sys/netinet6 nd6_nbr.c

ndp: Fix free after use and exclude delayed proxy

PR:     293777
Fixes:  f37fbe30f559 ("ndp: implement delayed ...")
DeltaFile
+12-10sys/netinet6/nd6_nbr.c
+12-101 files

HardenedBSD/src b5f564fsys/sys elf_common.h

sys/elf_common.h: Add the gABI spelling for a dynamic tag value.
DeltaFile
+4-1sys/sys/elf_common.h
+4-11 files

HardenedBSD/src b4d8d9bcontrib/jemalloc/src jemalloc.c

rallocx path: only set errno on the realloc case.

PR:             291677
Obtained from:  jemalloc (commit 83b075789b4239035931c1ee212576d00153bbf0)
Fixes:          c43cad871720 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2059

(cherry picked from commit 2c5cd07828ad76c332e3bedc29fc641809e85396)
DeltaFile
+3-1contrib/jemalloc/src/jemalloc.c
+3-11 files

HardenedBSD/src 3abef03contrib/jemalloc/src jemalloc.c

Set errno to ENOMEM on rallocx() OOM failures

realloc() and rallocx() shares path, and realloc() should set errno to
ENOMEM upon OOM failures.

PR:             291677
Obtained from:  jemalloc (commit 38056fea64c34ca4fef0a16212776eaa4de80b78)
Fixes:          c43cad871720 ("jemalloc: Merge from jemalloc 5.3.0 vendor branch")
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2059

(cherry picked from commit 5583b64f230fe0ea4e3d4bf4566205b521190fbb)
DeltaFile
+1-0contrib/jemalloc/src/jemalloc.c
+1-01 files

HardenedBSD/src c1e3f96sys/compat/freebsd32 freebsd32_misc.c, sys/compat/linux linux_misc.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+1-1sys/compat/freebsd32/freebsd32_misc.c
+1-0sys/compat/linux/linux_misc.c
+2-12 files

HardenedBSD/src 465b568sys/compat/freebsd32 freebsd32_misc.c, sys/compat/linux linux_misc.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1sys/compat/freebsd32/freebsd32_misc.c
+1-0sys/compat/linux/linux_misc.c
+2-12 files

HardenedBSD/src 9a9f93bsys/compat/linux linux_misc.c

compat/linux: Avoid waitid() kernel stack disclosure

Reported by:    Adam Crosser, Praetorian
Reviewed by:    philip
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55812
DeltaFile
+1-0sys/compat/linux/linux_misc.c
+1-01 files

HardenedBSD/src 097cb4esys/compat/freebsd32 freebsd32_misc.c

compat32: Zero struct to avoid stack disclosure

Reported by:    Adam Crosser, Praetorian
Reviewed by:    philip
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55811
DeltaFile
+1-1sys/compat/freebsd32/freebsd32_misc.c
+1-11 files

HardenedBSD/src 8ad93edsys/dev/sound/pcm feeder_volume.c, sys/kern uipc_shm.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+231-246sys/netinet/in_pcb.h
+10-1sys/dev/sound/pcm/feeder_volume.c
+2-0sys/kern/uipc_shm.c
+1-0usr.bin/calendar/calendars/calendar.freebsd
+0-1sys/net/debugnet_inet.c
+244-2485 files

HardenedBSD/src 8624944sys/dev/sound/pcm feeder_volume.c, sys/net debugnet_inet.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+231-246sys/netinet/in_pcb.h
+10-1sys/dev/sound/pcm/feeder_volume.c
+0-1sys/net/debugnet_inet.c
+1-0usr.bin/calendar/calendars/calendar.freebsd
+242-2484 files

HardenedBSD/src 4c72e5cusr.bin/calendar/calendars calendar.freebsd

calendar.freebsd: add myself (khorben@)

This adds my date and place of birth to FreeBSD's calendar file, so I
can let the system(tm) remind me when that counter increments.

Confirmed to be working with the following command:

```
$ calendar -f usr.bin/calendar/calendars/calendar.freebsd -t 18.08
Aug 18  Pierre Pronchery <khorben at FreeBSD.org> born in Nantes, France, 1982
[...]
```

Reviewed by:    philip (mentor)
Approved by:    philip (mentor)
Differential Revision:  https://reviews.freebsd.org/D55825
DeltaFile
+1-0usr.bin/calendar/calendars/calendar.freebsd
+1-01 files

HardenedBSD/src b094b48sys/kern uipc_shm.c

HBSD: Make sure the kinfo_file struct always gets zeroed

Similar to FreeBSD commit 25cc459286a02b646751541ccde5a33319471c73,
apply a memset in one of the core functions used to fill the structure.
This ensures that all kinfo_file structure allocations are zeroed (at
least, at the point of calling shm_fill_kinfo_locked).

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to:         15-STABLE
DeltaFile
+2-0sys/kern/uipc_shm.c
+2-01 files

HardenedBSD/src 041e9ebsys/netinet in_pcb.h

inpcb: overhaul in_pcb.h

Pull up all user-visible stuff to the top of the file and isolate the
rest under _KERNEL.  The user visible parts are:
- struct in_conninfo
- struct xinpcb
- defines for inp_flags bits, that are shared between xinpcb and inpcb

PR:     293493
DeltaFile
+231-246sys/netinet/in_pcb.h
+231-2461 files

HardenedBSD/src 0f1aa45sys/net debugnet_inet.c

debugnet: don't include udp_var.h

The module constructs UDP packets, but doesn't use the UDP stack.
DeltaFile
+0-1sys/net/debugnet_inet.c
+0-11 files

HardenedBSD/src ac5ff28sys/dev/sound/pcm feeder_volume.c

sound: enforce MASTER volume mute during playback

MASTER mute (vol.mute) works while audio is playing. However, if a
stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the
audio will resume even though the mixer shows the MASTER volume as
muted. Other streams that are already playing remain silent. New streams
may also start playing audio regardless of the MASTER mute state.

The volume feeder now considers the MASTER mute when determining whether
a channel should be muted. This ensures MASTER mute is consistently
enforced for all streams and removes the dependency on trigger-driven
state propagation.

Tested with Creative Labs CA0132 card.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D55605
DeltaFile
+10-1sys/dev/sound/pcm/feeder_volume.c
+10-11 files

HardenedBSD/src 5d9c41csys/fs/fuse fuse_node.h fuse_node.c, sys/netinet ip_carp.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+122-315sys/netinet/ip_carp.c
+192-0tests/sys/fs/fusefs/read.cc
+11-121usr.bin/systat/netstat.c
+80-11sys/fs/fuse/fuse_node.h
+90-0tests/sys/fs/fusefs/rename.cc
+71-18sys/fs/fuse/fuse_node.c
+566-46524 files not shown
+816-59830 files

HardenedBSD/src b7a704dsys/fs/fuse fuse_node.h fuse_node.c, sys/netinet ip_carp.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+122-315sys/netinet/ip_carp.c
+192-0tests/sys/fs/fusefs/read.cc
+11-121usr.bin/systat/netstat.c
+80-11sys/fs/fuse/fuse_node.h
+90-0tests/sys/fs/fusefs/rename.cc
+71-18sys/fs/fuse/fuse_node.c
+566-46524 files not shown
+816-59830 files

HardenedBSD/src cedaa6dsbin/camcontrol camcontrol.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+31-0sbin/camcontrol/camcontrol.c
+31-01 files

HardenedBSD/src 815ef05sys/netinet tcp_var.h in_pcb.h, sys/netinet/cc cc.h

netinet: remove _WANT_INPCB and _WANT_TCPCB

These were hacks since FreeBSD 12 that provided some transition period for
utilities to migrate from reading kernel memory via kvm(3) to sysctl(3)
based APIs.  The transition period is over.
DeltaFile
+4-4sys/netinet/cc/cc.h
+2-2sys/netinet/tcp_var.h
+1-1sys/netinet/in_pcb.h
+7-73 files

HardenedBSD/src c0462c2sys/netinet/tcp_stacks sack_filter.c

tcp: make sack_filter.c compilable without _WANT_TCPCB

This file can be compiled as a standalone program for debugging purposes.
Achieve that without exposing hack from tcp_var.h that is destined for
removal.
DeltaFile
+15-14sys/netinet/tcp_stacks/sack_filter.c
+15-141 files

HardenedBSD/src 985ac74usr.bin/systat netstat.c systat.h

systat: remove kvm(3) support for -netstat mode

The kvm(3) mode was actually non-functional since FreeBSD 8 for kernels
with VIMAGE, since FreeBSD 12 for the GENERIC kernel and since FreeBSD 14
for all kernels.  The reason for that is that systat(1) tried to lookup
symbol "tcb" to check if kvm(3) is working.  The symbol no longer exist in
the kernel.

A side effect was that systat(1) lost true kvm(3) support for all other
modes, e.g. -swap or -pigs.  The tool was still working, but libkvm was
just a shim to sysctl(3) API.

So, contrary to what the header line says, this change actually restores
the kvm(3) support for other modes.  Now we read the "allproc" symbol.

This was the last tool that abused _WANT_INPCB.
DeltaFile
+11-121usr.bin/systat/netstat.c
+0-11usr.bin/systat/systat.h
+3-2usr.bin/systat/main.c
+0-2usr.bin/systat/extern.h
+14-1364 files

HardenedBSD/src a68e3a8sys/net pfvar.h, sys/sys systm.h

systm.h: don't declare socket and inpcb globally
DeltaFile
+0-2sys/sys/systm.h
+1-0sys/net/pfvar.h
+1-22 files

HardenedBSD/src 72472e5sbin/ifconfig carp.c, share/man/man4 carp.4

carp: retire ioctl(2) API

All supported stable branches use netlink(4) API to configure carp(4).
The deleted code also has kernel stack leak vulnerability, that requires
extra effort to fix.

Reviewed by:            pouria, kp
Differential Revision:  https://reviews.freebsd.org/D55804
DeltaFile
+122-315sys/netinet/ip_carp.c
+0-15sys/netinet/ip_carp.h
+3-9share/man/man4/carp.4
+0-10sys/net/if.c
+7-2sbin/ifconfig/carp.c
+1-1sys/sys/param.h
+133-3526 files

HardenedBSD/src 7e68af7sys/fs/fuse fuse_node.h fuse_node.c, tests/sys/fs/fusefs read.cc rename.cc

fusefs: redo vnode attribute locking

Previously most fields in fuse_vnode_data were protected by the vnode
lock.  But because DEBUG_VFS_LOCKS was never enabled by default until
stable/15 the assertions were never checked, and many were wrong.
Others were missing.  This led to panics in stable/15 and 16.0-CURRENT,
when a vnode was expected to be exclusively locked but wasn't, for fuse
file systems that mount with "-o async".

In some places it isn't possible to exclusively lock the vnode when
accessing these fields.  So protect them with a new mutex instead.  This
fixes panics and unprotected field accesses in VOP_READ,
VOP_COPY_FILE_RANGE, VOP_GETATTR, VOP_BMAP, and FUSE_NOTIFY_INVAL_ENTRY.
Add assertions everywhere the protected fields are accessed.

Lock the vnode exclusively when handling FUSE_NOTIFY_INVAL_INODE.

During fuse_vnode_setsize, if the vnode isn't already exclusively
locked, use the vn_delayed_setsize mechanism.  This fixes panics during

    [13 lines not shown]
DeltaFile
+192-0tests/sys/fs/fusefs/read.cc
+80-11sys/fs/fuse/fuse_node.h
+90-0tests/sys/fs/fusefs/rename.cc
+71-18sys/fs/fuse/fuse_node.c
+74-7sys/fs/fuse/fuse_vnops.c
+24-18sys/fs/fuse/fuse_internal.c
+531-545 files not shown
+609-7911 files

HardenedBSD/src ce9aff8sys/dev/hwpmc hwpmc_amd.c

hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases

The previous code subtracted AMD_PMC_PERFCTR_0 (0xC0010004) from all
perfctr MSR addresses to compute a relative offset. This is incorrect
for counters using AMD_PMC_CORE_BASE (0xC0010200), AMD_PMC_L3_BASE
(0xC0010230), and AMD_PMC_DF_BASE (0xC0010240), producing wrong offsets.

Fix by promoting amd_core_npmcs, amd_l3_npmcs, and amd_df_npmcs to
static module-level variables and computing the correct flat RDPMC
index per AMD BKDG 24594 page 440:

ECX 0-5:   Core counters 0-5
ECX 6-9:   DF counters 0-3
ECX 10-15: L3 Cache counters 0-5
ECX 16-27: DF counters 4-15
ECX > 27:  Reserved, returns EINVAL

Reviewed by:    Ali Mashtizadeh <ali at mashtizadeh.com>, mhorne
Sponsored by:   NLINK (https://nlink.com.br), Recife, Brazil

    [2 lines not shown]
DeltaFile
+33-3sys/dev/hwpmc/hwpmc_amd.c
+33-31 files