HardenedBSD/src 0ccd224sys/arm64/arm64 trap.c, sys/compat/linuxkpi/common/src linux_simple_attr.c linux_seq_file.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+9-21sys/arm64/arm64/trap.c
+2-11sys/compat/linuxkpi/common/src/linux_simple_attr.c
+3-9sys/compat/linuxkpi/common/src/linux_seq_file.c
+14-413 files

HardenedBSD/src e720e42sys/arm64/arm64 trap.c, sys/compat/linuxkpi/common/src linux_simple_attr.c linux_seq_file.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+9-21sys/arm64/arm64/trap.c
+2-11sys/compat/linuxkpi/common/src/linux_simple_attr.c
+3-9sys/compat/linuxkpi/common/src/linux_seq_file.c
+14-413 files

HardenedBSD/src 6aeddadusr.sbin/virtual_oss/virtual_oss main.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+3-21usr.sbin/virtual_oss/virtual_oss/main.c
+3-211 files

HardenedBSD/src 14e9744sys/arm64/arm64 trap.c

arm64: Have a common call to userret

Rather than each exception calling userret use a common copy. As
syscallret already calls userret we need to skip it in that case.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55250
DeltaFile
+9-21sys/arm64/arm64/trap.c
+9-211 files

HardenedBSD/src 58d74d7sys/compat/linuxkpi/common/src linux_simple_attr.c linux_seq_file.c

LinuxKPI: Use simple_read_from_buffer in simple_attr_read and seq_read

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D55879
DeltaFile
+2-11sys/compat/linuxkpi/common/src/linux_simple_attr.c
+2-9sys/compat/linuxkpi/common/src/linux_seq_file.c
+4-202 files

HardenedBSD/src c181c8fsys/compat/linuxkpi/common/src linux_seq_file.c

LinuxKPI: Clear the sbuf at the start of each call to seq_read

Each invocation of seq_read invokes the seq_file.show callback which
writes into the sbuf.  Then it invokes sbuf_finish before copying the
data into the caller's buffer.  Without this, a second call to
seq_read on the same file would try to append data to a finished sbuf.

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
DeltaFile
+1-0sys/compat/linuxkpi/common/src/linux_seq_file.c
+1-01 files

HardenedBSD/src 80d813dsys/dev/virtio virtqueue.c, sys/net if_bridge.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+2-2sys/net/if_bridge.c
+2-1sys/netinet6/nd6.c
+1-1sys/dev/virtio/virtqueue.c
+5-43 files

HardenedBSD/src 572a8aesys/dev/virtio virtqueue.c, sys/net if_bridge.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2-2sys/net/if_bridge.c
+2-1sys/netinet6/nd6.c
+1-1sys/dev/virtio/virtqueue.c
+5-43 files

HardenedBSD/src edc9c3eusr.sbin/virtual_oss/virtual_oss main.c

virtual_oss: Combine -d, -l and -L option getopt code

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55671

(cherry picked from commit a2b601343bf9261c4ada51e4d4c30c5b9320bb2b)
DeltaFile
+3-21usr.sbin/virtual_oss/virtual_oss/main.c
+3-211 files

HardenedBSD/src 1d13d93sys/dev/virtio virtqueue.c

virtio: Ensure power-of-two alignment for indirect queue

Some platforms enforce power-of-two alignment for bus_dma tags. Rounding up
the natural size may result in over-alignment, but should be safe.

PR:             293770
Reviewed by:    andrew
Fixes:          c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations")
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55843
DeltaFile
+1-1sys/dev/virtio/virtqueue.c
+1-11 files

HardenedBSD/src 7b9bb32sys/netinet6 nd6.c

ndp: don't send unsolicited NA for multicast address

During link-layer address change event, don't send unsolicited
NA for multicast addresses.

Reviewed by: adrian, zlei
Differential Revision: https://reviews.freebsd.org/D55885
DeltaFile
+2-1sys/netinet6/nd6.c
+2-11 files

HardenedBSD/src a8b9a05sys/net if_bridge.c

if_bridge(4): don't sleep under epoch(9) in destruction

bridge tries to run callout_drain(9) twice under epoch
during destruction.
once for bridge_timer, which is not required to be under epoch.
second time for the BSTP callout, which is already disabled
earlier inside bridge_delete_member.

Reviewed by: glebius, zlei
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D55876
DeltaFile
+2-2sys/net/if_bridge.c
+2-21 files

HardenedBSD/src 1c78e81sys/fs/nfsserver nfs_nfsdserv.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+13-1sys/fs/nfsserver/nfs_nfsdserv.c
+13-11 files

HardenedBSD/src 543b53dsys/fs/nfsserver nfs_nfsdserv.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+13-1sys/fs/nfsserver/nfs_nfsdserv.c
+13-11 files

HardenedBSD/src 9e22769sys/fs/nfsclient nfs_clvnops.c, sys/fs/p9fs p9fs_vnops.c p9fs.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+72-2sys/kern/vfs_vnops.c
+7-61sys/fs/nfsclient/nfs_clvnops.c
+43-7sys/fs/p9fs/p9fs_vnops.c
+31-0sys/sys/vnode.h
+6-3sys/fs/p9fs/p9fs.h
+8-0sys/kern/vnode_if.src
+167-736 files not shown
+177-8212 files

HardenedBSD/src 3acad36lib/libpmc libpmc.c, sys/dev/hwpmc hwpmc_mod.c hwpmc_amd.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+45-0sys/dev/hwpmc/hwpmc_mod.c
+9-10lib/libpmc/libpmc.c
+6-13sys/dev/nvme/nvme_private.h
+15-2sys/sys/pmc.h
+15-0sys/dev/hwpmc/hwpmc_amd.c
+5-2usr.sbin/pmcstat/pmcstat.c
+95-277 files not shown
+109-4113 files

HardenedBSD/src d0f4057lib/libpmc libpmc.c, sys/dev/hwpmc hwpmc_mod.c hwpmc_amd.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+45-0sys/dev/hwpmc/hwpmc_mod.c
+9-10lib/libpmc/libpmc.c
+6-13sys/dev/nvme/nvme_private.h
+15-2sys/sys/pmc.h
+15-0sys/dev/hwpmc/hwpmc_amd.c
+3-4sys/dev/nvme/nvme_qpair.c
+93-297 files not shown
+109-4113 files

HardenedBSD/src e39d3a6sys/sys pmc.h

pmc.h: bump PMC_VERSION_MINOR

Bump for the addition of PMC_OP_GETCAPS and the recently added Intel
CPUs.

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

HardenedBSD/src 209d9fbusr.sbin/pmcstat pmcstat.c

pmcstat: Implement PMC_CAP_SYSWIDE

Implement the PMC_CAP_SYSWIDE capability flag in the same manner as the
PMC_CAP_DOMWIDE flag.  This flag was previously introduced along side
the domain wide flag, but is yet to be used anywhere.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2075
DeltaFile
+5-2usr.sbin/pmcstat/pmcstat.c
+5-21 files

HardenedBSD/src 44a983dlib/libpmc libpmc.c, share/man/man4 hwpmc.4

libpmc: Query hwpmc for caps

This change allows for fine-grained capabilities per counter index. This
is particularly useful for AMD where subclasses are not exposed to the
general PMC code, but other architectures also have asymmetric behaviors
when it comes to specific counter indices.

A new PMC_OP_GETCAPS op is added to the hwpmc(4) ioctl interface.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2058
DeltaFile
+45-0sys/dev/hwpmc/hwpmc_mod.c
+9-10lib/libpmc/libpmc.c
+15-0sys/dev/hwpmc/hwpmc_amd.c
+14-1sys/sys/pmc.h
+4-0share/man/man4/hwpmc.4
+87-115 files

HardenedBSD/src f0e0c4clib/libpmc/pmu-events jevents.c

jevents: include file path in whitelist error message

A small enhancement.

Reviewed by:    Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55830
DeltaFile
+1-1lib/libpmc/pmu-events/jevents.c
+1-11 files

HardenedBSD/src 6580d04sys/fs/nfsserver nfs_nfsdserv.c

nfs_nfsdserv.c: Fix handling of archive flag for mkdir

An NFSv4.1/4.2 client can set/clear the archive, hidden
and system flags when creating non-regular files, such
as directories.

Without this patch, the setting of va_flags causes an
EPERM failure, since they are specified for VOP_MKDIR(),
VOP_MKNOD() and VOP_SYMLINK().

This patch sets va_flags == VNOVAL for the above VOP_xxx()
calls and then sets/clears the flags after creation,
which fixes the problem.

This bug only affects the Windows NFSv4.1/4.2 client.

PR:     293691
Tested by:      Dan Shelton <dan.f.shelton at gmail.com>
MFC after:      2 weeks
DeltaFile
+13-1sys/fs/nfsserver/nfs_nfsdserv.c
+13-11 files

HardenedBSD/src 83d7a49sys/vm vm_fault.c

vm_fault: expand KASSERT message in vm_fault_populate_cleanup

Include index values and object pointer in the diagnostic
to improve debugging of pindex mismatches.

No functional change.

Signed-off-by: Isa Isoux <isa at isoux.org>
Reviewed by: kib, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2038
DeltaFile
+4-1sys/vm/vm_fault.c
+4-11 files

HardenedBSD/src aa15df4sys/sys queue.h

queue.h: Reorder STAILQ_INSERT_TAIL

The current implementation briefly violates the tail invariant.  This
is not usually an issue, but if an insert is in flight when a panic
occurs, we may then trip the invariant while dumping core.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    obiwac, olce, jhb
Differential Revision:  https://reviews.freebsd.org/D55819
DeltaFile
+2-1sys/sys/queue.h
+2-11 files

HardenedBSD/src 541fbf2sys/net if.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+3-21sys/net/if.c
+3-211 files

HardenedBSD/src bbffe59sys/net if.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+3-21sys/net/if.c
+3-211 files

HardenedBSD/src 889d10dsys/dev/nvme nvme_private.h nvme_qpair.c

nvme: Replace bus_space_[read|write]_4 with bus_[read|write]_4

The goal this change is to remove the use of the tag and handle
needed by bus_space_[read|write]_4.

Fixes:                  b3d9e5013f3e5 (Don't active memory space)
Requested by:           jhb
Reviewed by:            gallatin, imp, jhb, jrtc27
Differential Revision:  https://reviews.freebsd.org/D55818
DeltaFile
+6-11sys/dev/nvme/nvme_private.h
+3-4sys/dev/nvme/nvme_qpair.c
+0-3sys/dev/nvme/nvme_pci.c
+0-2sys/dev/nvme/nvme_ahci.c
+9-204 files

HardenedBSD/src 4e3beefsys/dev/nvme nvme_private.h nvme_ahci.c

nvme: Removed unused 'regs' variable

The private struct has a 'regs' member that's only written to
and otherwise unused. This change removes it.

Fixes:                  b3d9e5013f3e5 (Don't active memory space)
Requested by:           jhb
Reviewed by:            imp, jhb, jrtc27
Differential Revision:  https://reviews.freebsd.org/D55817
DeltaFile
+0-2sys/dev/nvme/nvme_private.h
+0-1sys/dev/nvme/nvme_ahci.c
+0-1sys/dev/nvme/nvme_pci.c
+0-43 files

HardenedBSD/src e073105sys/net if.c

ifnet: Remove unreachable code

The ioctls SIOCSIFVNET and SIOCSIFRVNET are for userland only. For
SIOCSIFVNET, if_vmove_loan(), the interface is obtained from current
VNET. For SIOCSIFRVNET, if_vmove_reclaim(), a valid child prison is
held before getting the interface. In both cases the VNET of the
obtained interfaces is stable, so there's no need to check it.

No functional change intended.

Reviewed by:    glebius, jamie (for #jails)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55828
DeltaFile
+0-18sys/net/if.c
+0-181 files

HardenedBSD/src 8065ff6sys/net if.c

ifnet: Fix decreasing the vnet interface count

It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by:    kp, pouria
Fixes:          a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55873
DeltaFile
+3-3sys/net/if.c
+3-31 files