HardenedBSD/src 817156clib/msun/arm fenv.c, lib/msun/riscv fenv.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+419-311sys/netinet/ip_mroute.c
+382-190sys/netinet6/ip6_mroute.c
+428-0tests/sys/netinet/ip_mroute.py
+191-0tests/sys/netinet/ip6_mrouted.c
+105-33lib/msun/arm/fenv.c
+71-18lib/msun/riscv/fenv.c
+1,596-55233 files not shown
+2,039-74639 files

HardenedBSD/src 83d6e7elib/msun/arm fenv.c, lib/msun/riscv fenv.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+419-311sys/netinet/ip_mroute.c
+382-190sys/netinet6/ip6_mroute.c
+428-0tests/sys/netinet/ip_mroute.py
+191-0tests/sys/netinet/ip6_mrouted.c
+105-33lib/msun/arm/fenv.c
+71-18lib/msun/riscv/fenv.c
+1,596-55233 files not shown
+2,039-74639 files

HardenedBSD/src 521ab34sbin/pfctl pfctl.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+3-2sbin/pfctl/pfctl.c
+3-21 files

HardenedBSD/src d157330lib/msun/aarch64 fenv.c, lib/msun/amd64 fenv.c

msun: remove requirement to have C99 inline semantic

The 'extern inline' usage is removed.

PR:     277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
DeltaFile
+0-5lib/msun/amd64/fenv.c
+0-5lib/msun/arm/fenv.c
+0-5lib/msun/i387/fenv.c
+0-5lib/msun/powerpc/fenv.c
+0-5lib/msun/riscv/fenv.c
+0-5lib/msun/aarch64/fenv.c
+0-306 files

HardenedBSD/src e4505a5lib/msun/powerpc fenv.c fenv.h

msun/powerpc: convert fenv functions to proper linkage

namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     277958
Reviewed by:    dim

    [3 lines not shown]
DeltaFile
+71-12lib/msun/powerpc/fenv.c
+39-12lib/msun/powerpc/fenv.h
+110-242 files

HardenedBSD/src 7067443lib/msun/arm fenv.c fenv.h

msun/arm: convert fenv functions to proper linkage

namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     277958
Reviewed by:    dim

    [3 lines not shown]
DeltaFile
+105-28lib/msun/arm/fenv.c
+45-13lib/msun/arm/fenv.h
+150-412 files

HardenedBSD/src 6b89f53lib/msun/riscv fenv.c fenv.h

msun/riscv: convert fenv functions to proper linkage

namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     277958
Reviewed by:    dim

    [3 lines not shown]
DeltaFile
+71-13lib/msun/riscv/fenv.c
+39-12lib/msun/riscv/fenv.h
+110-252 files

HardenedBSD/src 5bc64b7lib/msun/amd64 fenv.c, lib/msun/i387 fenv.c

msun/x86: convert rest of the extern inline fenv functions to proper linkage

namely
        fegetexceptflag(3)
        fetestexcept(3)
        fesetround(3)
        fegetround(3)
        fesetenv(3)
Same as it was done in f39754d51b7dc65c4cf9f for feclearexcept(3).

PR:     277958
Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56139
DeltaFile
+27-5lib/msun/amd64/fenv.c
+27-5lib/msun/i387/fenv.c
+20-9lib/msun/x86/fenv.h
+74-193 files

HardenedBSD/src 3a01e1elib/msun/aarch64 fenv.c fenv.h

msun/aarch64: convert fenv functions to proper linkage

namely
        fegetexceptflag(3)
        fesetexceptflag(3)
        feraiseexcept(3)
        fetestexcept(3)
        fegetround(3)
        fesetround(3)
        fegetenv(3)
        feholdexcept(3)
        fesetenv(3)
        feupdateenv(3)
        feenableexcept(3)
        fedisableexcept(3)
        fegetexcept(3)

PR:     277958
Reviewed by:    dim

    [3 lines not shown]
DeltaFile
+59-13lib/msun/aarch64/fenv.c
+31-10lib/msun/aarch64/fenv.h
+90-232 files

HardenedBSD/src 7cfffe2libexec/rtld-elf rtld.c

rtld: check for overflow in parse_integer()

Reviewed by:    dim, emaste, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56151
DeltaFile
+4-0libexec/rtld-elf/rtld.c
+4-01 files

HardenedBSD/src 82272cbsys/netinet6 ip6_mroute.c

ip6_mroute: Pass the multicast interface number directly to del_m6if()

There's no need to pass a pointer to the interface number.  No
functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55245
DeltaFile
+13-13sys/netinet6/ip6_mroute.c
+13-131 files

HardenedBSD/src a1c042asys/netinet6 ip6_mroute.c

ip6_mroute: Handle interface detach events

When an interface goes away we need to make sure the v6 multicast
routing tables don't carry any dangling references to the ifnet.  The v4
code handles this already.  Copy the approach there and use an
eventhandler to purge the corresponding MIF, if one exists, and further
go through all routes in the FIB and remove references to the interface.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55246
DeltaFile
+67-2sys/netinet6/ip6_mroute.c
+67-21 files

HardenedBSD/src 0bb9c2bsys/netinet6 ip6_mroute.c in6.c

ip6_mroute: FIBify

Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55242
DeltaFile
+77-54sys/netinet6/ip6_mroute.c
+6-11sys/netinet6/in6.c
+1-1sys/netinet6/ip6_mroute.h
+1-1sys/netinet6/raw_ip6.c
+85-674 files

HardenedBSD/src 4c486fesys/netinet ip_mroute.c ip_output.c

ip_mroute: FIBify

Modify the control plane (ioctl and socket option handlers) to use the
routing socket FIB to index into the mfctable array.  Modify the
forwarding plane to use the mbuf's FIB to determine which routing table
to use.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55241
DeltaFile
+167-152sys/netinet/ip_mroute.c
+6-5sys/netinet/ip_output.c
+3-2sys/netinet/ip_mroute.h
+2-2sys/netinet/raw_ip.c
+2-1sys/netinet/in_mcast.c
+180-1625 files

HardenedBSD/src 09e702atests/sys/netinet ip_mroute.py ip6_mrouted.c, tests/sys/netinet6 Makefile

tests: Add some simple regression tests for ip_mroute

These use atf_python to create a number of hosts linked to a router.
The router runs pimd (for IPv4) or ip6_mrouter (simplistic IPv6
multicast router that I wrote since I couldn't find one in the ports
tree).  The vnet_host*_handler() methods are invoked in different VNET
jails connected to the router; they register the connected epair with a
multicast group and verify that they can send messages to each other.

The tests are synchronized by sending messages over a unix domain
socket.  The flow is something like:
1) test startup_method() is called, the unix socket is created,
2) the superclass creates jails and links them together using the
   declared topology,
3) we wait for all child jails to start up and send a message on the
   unix socket indicating that they are ready
4) we start the routing daemon in the main jail,
5) the test actually starts; starttest() kicks off the
   vnet_host*_handlers(), which mostly just verify that they can send

    [11 lines not shown]
DeltaFile
+428-0tests/sys/netinet/ip_mroute.py
+191-0tests/sys/netinet/ip6_mrouted.c
+9-4tests/sys/netinet/Makefile
+1-0tests/sys/netinet6/Makefile
+629-44 files

HardenedBSD/src d4339cesys/netinet6 ip6_mroute.h

ip6_mroute: Make ip6_mroute.h more self-contained

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55243
DeltaFile
+3-0sys/netinet6/ip6_mroute.h
+3-01 files

HardenedBSD/src 97a4bc9sys/netinet ip_mroute.c, sys/netinet6 ip6_mroute.c

ip(6)_mroute: Grow the routing tables when the number of FIBs changes

Use the new rtnumfibs_change event to expand the mfctable array when the
number of FIBs increases.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55240
DeltaFile
+44-10sys/netinet/ip_mroute.c
+40-3sys/netinet6/ip6_mroute.c
+84-132 files

HardenedBSD/src 81dbacbsys/net route.h, sys/net/route route_tables.c

net/route: Add an eventhandler for rt_numfibs changes

The multicast routing code will start implementing per-FIB routing
tables.  As a part of this, it needs to be notified when the number of
FIBs changes, so that it can expand its tables.

Add an eventhandler for this purpose.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55239
DeltaFile
+6-0sys/net/route.h
+3-1sys/net/route/route_tables.c
+9-12 files

HardenedBSD/src a223d6csys/netinet6 ip6_mroute.c

ip6_mroute: Start putting global variables into a structure

As in the IPv4 version of this change, I added a struct mf6ctable
structure which holds all global routing table state, soon to become
per-FIB state.

Note that much of the v6 multicast routing code was not VNETified; this
change fixes that too.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55238
DeltaFile
+229-162sys/netinet6/ip6_mroute.c
+229-1621 files

HardenedBSD/src d50d0c0sys/netinet ip_mroute.c

ip_mroute: Start moving globals into a structure

I would like to support per-FIB multicast routing tables, such that one
can run a routing daemon per-FIB, with each daemon oblivious to the
existence of others.  Currently the multicast routing code is completely
unaware of FIBs.

To that end, start collecting various global variables in ip_mroute.c
into a per-VNET struct mfctable.  In a future patch this will be
expanded into an array of mfctable structures, one per FIB.  For now,
all of the state is collected into V_mfctables[0].

Each mfctable contains, among other things:
- a pointer to the routing socket, if routing is enabled,
- a hash table of routing cache entries,
- an table of network interfaces participating in the routing
  configuration

This change has no functional effect, it is just factoring out these

    [6 lines not shown]
DeltaFile
+266-207sys/netinet/ip_mroute.c
+266-2071 files

HardenedBSD/src ee9456csys/net if.c

ifnet: Fix races in if_vmove_reclaim()

The thread running if_vmove_reclaim() may race with other threads those
running if_detach(), if_vmove_loan() or if_vmove_reclaim(). In case the
current thread loses race, two issues arise,

 1. It is unstable and unsafe to access ifp->if_vnet,
 2. The interface is removed from "active" list, hence if_unlink_ifnet()
    can fail.

For the first case, check against source prison's vnet instead, given
the interface is obtained from that vnet.

For the second one, return ENODEV to indicate the interface was on the
list but the current thread loses race, to distinguish from ENXIO, which
means the interface or child prison is not found. This is the same with
if_vmove_loan().

Reviewed by:    kp, pouria

    [3 lines not shown]
DeltaFile
+9-5sys/net/if.c
+9-51 files

HardenedBSD/src 5b8ab97sbin/pfctl pfctl.c

pfctl: parser must not ignore error from pfctl_optimize_ruleset()

Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.

Issue reported and fix suggested by berts _from_ fastmail _dot_ com

'Looks good.' @deraadt

MFC after:      1 week
Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 9fd28a8cca
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
DeltaFile
+3-2sbin/pfctl/pfctl.c
+3-21 files

HardenedBSD/src 0f14778lib/libsys stat.2, sys/sys stat.h

stat(2): Send to sticky(7) in the S_ISVTX description

Approved by: ziaee
Differential Revision: https://reviews.freebsd.org/D56015
DeltaFile
+1-1lib/libsys/stat.2
+1-1sys/sys/stat.h
+2-22 files

HardenedBSD/src 0efd333sys/dev/sound/usb uaudio_pcm.c uaudio.c

snd_uaudio: Retire sndcard_func usage

This is effectively a no-op, as it does not make use of the
sndcard_func->varinfo field, so eventually ua_probe() always succeeds.

Also change ua_probe()'s value to 0. There is no need to return
BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
with bus_attach_children().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56160
DeltaFile
+1-12sys/dev/sound/usb/uaudio_pcm.c
+0-5sys/dev/sound/usb/uaudio.c
+1-172 files

HardenedBSD/src 0a6dbf5etc/mtree BSD.usr.dist, libexec/atf/atf-sh Makefile

pkgbase: Move all of ATF into the atf package

Parts of ATF (including the licence and some of the documentation) were
for some reason part of the tests package instead of the atf package.
Moving them to where they logically belong poses no problem since tests
already depends on atf.

PR:             294129
MFC after:      1 week
Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D56158
DeltaFile
+6-6share/doc/atf/Makefile
+5-5share/man/man4/Makefile
+5-5share/man/man1/Makefile
+2-2etc/mtree/BSD.usr.dist
+0-1libexec/atf/atf-sh/Makefile
+18-195 files

HardenedBSD/src 40e8afaetc/mtree BSD.usr.dist BSD.root.dist

pkgbase: Move all of Kyua into the kyua package

Some Kyua directories were improperly tagged as belonging to the tests
package.  Move them to the kyua package, which contains all of the
files found in these directories.

PR:             294129
MFC after:      1 week
Reviewed by:    ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D56159
DeltaFile
+5-5etc/mtree/BSD.usr.dist
+1-1etc/mtree/BSD.root.dist
+6-62 files

HardenedBSD/src cc2715csys/x86/acpica acpi_apm.c

acpi_apm: Narrow scope of ACPI_LOCK

This lock doesn't need to be held across seldrain/knlist_destroy.  It
is also redundant (and a bug) to hold it across knlist_add and
knlist_remove since it is the mutex for the knlist.

PR:             293901
Reported by:    Jiaming Zhang <r772577952 at gmail.com>
Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55994
DeltaFile
+2-6sys/x86/acpica/acpi_apm.c
+2-61 files

HardenedBSD/src 71bd001sys/amd64/vmm x86.c, sys/dev/nvme nvme_sim.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+10-12sys/kern/vfs_vnops.c
+12-3sys/amd64/vmm/x86.c
+1-1sys/dev/nvme/nvme_sim.c
+23-163 files

HardenedBSD/src c1642besys/amd64/vmm x86.c, sys/dev/nvme nvme_sim.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+10-12sys/kern/vfs_vnops.c
+12-3sys/amd64/vmm/x86.c
+1-1sys/dev/nvme/nvme_sim.c
+23-163 files

HardenedBSD/src 2a8d067share/man/man9 DEVICE_IDENTIFY.9, stand/powerpc/ofw ppc-common.ldscript

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+5-4sys/security/mac_do/mac_do.c
+2-6sys/kern/kern_cpu.c
+1-1stand/powerpc/ofw/ppc-common.ldscript
+1-1share/man/man9/DEVICE_IDENTIFY.9
+1-1sys/net/if_types.h
+1-1sys/ofed/include/rdma/ib_mad.h
+11-146 files