HardenedBSD/src f935a7esys/compat/linux linux_socket.c, sys/fs/unionfs union_vnops.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+15-7sys/fs/unionfs/union_vnops.c
+13-0sys/compat/linux/linux_socket.c
+4-0sys/netinet/if_ether.c
+1-1sys/net/if_arp.h
+33-84 files

HardenedBSD/src b07ba4abin/cp utils.c cp.c, sys/fs/nullfs null_vfsops.c

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+122-285usr.bin/xinstall/xinstall.c
+12-19usr.bin/xinstall/install.1
+21-8bin/cp/utils.c
+9-4bin/cp/cp.c
+8-0usr.bin/xinstall/tests/install_test.sh
+4-3sys/fs/nullfs/null_vfsops.c
+176-3194 files not shown
+183-32210 files

HardenedBSD/src c8d6c93sys/fs/unionfs union_vnops.c

unionfs_lookup(): fix wild accesses to vnode private data

There are a few spots in which unionfs_lookup() accesses unionfs vnode
private data without holding the corresponding vnode lock or interlock.

Reviewed by:            kib, olce
Differential Revision:  https://reviews.freebsd.org/D44601

(cherry picked from commit b18029bc59d2ed6b0eeeb233189cf713b34b467c)
DeltaFile
+15-7sys/fs/unionfs/union_vnops.c
+15-71 files

HardenedBSD/src 82c8a5fsys/fs/nullfs null_vfsops.c

nullfs: Show correct exported flag.

MFC after:      3 days
Reviewed by:    allanjude, kib
Differential Revision:  https://reviews.freebsd.org/D44773

(cherry picked from commit 2b258dd17caf329bc549f93d9858b74109a479d7)
DeltaFile
+4-3sys/fs/nullfs/null_vfsops.c
+4-31 files

HardenedBSD/src 44101ebusr.bin/xinstall xinstall.c install.1, usr.bin/xinstall/tests install_test.sh

install: Always use a temporary file.

Previously, we would only use a temporary file if explicitly asked to
with the `-S` option, and even then, only if the target file already
existed.  This meant that an outside observer looking for the target
file might see a partial file, and might see the file disappear and
then reappear.

With this patch, we always use a temporary file, ensuring atomicity.
The downside is slightly increased disk usage.  The upside is never
having to worry about, for instance, cron jobs randomly failing if
they happen to run simultaneously with `make installworld`.

The `-S` option is retained, partly for compatibility, and partly
to control the use of `fsync(2)`, which has a non-negligible cost
(approximately 10% increase in wall time for `make installworld`).

MFC after:      1 week
Sponsored by:   Klara, Inc.

    [52 lines not shown]
DeltaFile
+122-285usr.bin/xinstall/xinstall.c
+12-19usr.bin/xinstall/install.1
+8-0usr.bin/xinstall/tests/install_test.sh
+142-3043 files

HardenedBSD/src 1799750bin/cp utils.c cp.c

cp: Clarify an obscure comment.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D44805

(cherry picked from commit 64d6925d1901637125f9f739282e72c992657dc8)

cp: Additional sanity check.

Once we've successfully opened the file we've been asked to copy, check
that it's of the same type as FTS told us it was.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude, markj
Differential Revision:  https://reviews.freebsd.org/D44806


    [8 lines not shown]
DeltaFile
+21-8bin/cp/utils.c
+9-4bin/cp/cp.c
+30-122 files

HardenedBSD/src 1d06b45sys/fs/devfs devfs_vfsops.c, sys/fs/fdescfs fdesc_vfsops.c

Fix MNT_IGNORE for devfs, fdescfs and nullfs

The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.

The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.

MFC after:      1 week

(cherry picked from commit b5c4616582cebdcf4dee909a3c2f5b113c4ae59e)
DeltaFile
+1-1sys/fs/devfs/devfs_vfsops.c
+1-1sys/fs/fdescfs/fdesc_vfsops.c
+1-1sys/fs/nullfs/null_vfsops.c
+3-33 files

HardenedBSD/src 90499f6sys/net if_arp.h, sys/netinet if_ether.c

Support ARP for 802 networks

This is used by 802.3 Ethernet.  (Also be used by 802.4 Token Bus and
802.5 Token Ring, but we don't support those.)

This was accidentally removed along with FDDI support in commit
0437c8e3b198, presumably because comments implied it was used only by
FDDI or Token Ring.

Fixes: 0437c8e3b198 ("Remove support for FDDI networks.")
Reviewed-by: emaste
Signed-off-by: Denny Page <dennypage at me.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1166
(cherry picked from commit fcdf9a19893b9b5beb7a21407de507f0ae4c500b)
(cherry picked from commit d776dd5fbd484acdf00f6df55583e9aa53226859)
DeltaFile
+4-0sys/netinet/if_ether.c
+1-1sys/net/if_arp.h
+5-12 files

HardenedBSD/src d776dd5sys/net if_arp.h, sys/netinet if_ether.c

Support ARP for 802 networks

This is used by 802.3 Ethernet.  (Also be used by 802.4 Token Bus and
802.5 Token Ring, but we don't support those.)

This was accidentally removed along with FDDI support in commit
0437c8e3b198, presumably because comments implied it was used only by
FDDI or Token Ring.

Fixes: 0437c8e3b198 ("Remove support for FDDI networks.")
Reviewed-by: emaste
Signed-off-by: Denny Page <dennypage at me.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1166
(cherry picked from commit fcdf9a19893b9b5beb7a21407de507f0ae4c500b)
DeltaFile
+4-0sys/netinet/if_ether.c
+1-1sys/net/if_arp.h
+5-12 files

HardenedBSD/src 8c81694sys/compat/linux linux_socket.c

linux: ignore setsockopt(IPV6_RECVERR)

Under Linux, the socket options IP_RECVERR and IPV6_RECVERR are used to
receive socket errors via a dedicated 'error queue' which can be
retrieved via recvmsg().  FreeBSD does not support this functionality.

For IPv4, the sysctl compat.linux.ignore_ip_recverr can be set to 1 to
silently ignore attempts to set IP_RECVERR and return success to the
application, which is wrong, but is required for (among other things)
a functional DNS client in recent versions of glibc.

Add support for ignoring IPV6_RECVERR, controlled by the same sysctl.
This fixes DNS in Linux when using IPv6 resolvers.

Reviewed by: imp, Jose Luis Duran
Pull Request: https://github.com/freebsd/freebsd-src/pull/1118

(cherry picked from commit ca63710d3668cf6f3cb4faf065d8b4eeffa028ad)
DeltaFile
+13-0sys/compat/linux/linux_socket.c
+13-01 files

HardenedBSD/src 36be765sys/dev/sound/pci hdspe.c hdspe.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+2-1sys/dev/sound/pci/hdspe.c
+1-0sys/dev/sound/pci/hdspe.h
+3-12 files

HardenedBSD/src 2ca5010contrib/less ch.c

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+2-11contrib/less/ch.c
+2-111 files

HardenedBSD/src 4ddc74acontrib/less ch.c

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+2-11contrib/less/ch.c
+2-111 files

HardenedBSD/src 9718d4asys/dev/sound/pci hdspe.c hdspe.h

snd_hdspe(4): Recognize newer firmware's PCI vendor id.

At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI
vendor id instead of the Xilinx one. Other HDSPe cards are probably also
affected. Update snd_hdspe(4) to recognize both the old Xilinx and the
new RME vendor ids.

Differential Revision:  https://reviews.freebsd.org/D44978
MFC after: 1 day
DeltaFile
+2-1sys/dev/sound/pci/hdspe.c
+1-0sys/dev/sound/pci/hdspe.h
+3-12 files

HardenedBSD/src 302d0accontrib/less ch.c

MFV: less: Do not trust st_size if it equals zero

This is a smaller version of upstream
1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
issue that less not being able to operate on files
residing in pseudo-filesystems that advertize a zero
size value.

PR:             bin/276133

(cherry picked from commit cae336280b0d7ad3d49788c5fc0986f91328eb50)
DeltaFile
+2-11contrib/less/ch.c
+2-111 files

HardenedBSD/src 5132cb4contrib/less ch.c

MFV: less: Do not trust st_size if it equals zero

This is a smaller version of upstream
1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
issue that less not being able to operate on files
residing in pseudo-filesystems that advertize a zero
size value.

PR:             bin/276133

(cherry picked from commit cae336280b0d7ad3d49788c5fc0986f91328eb50)
DeltaFile
+2-11contrib/less/ch.c
+2-111 files

HardenedBSD/src 7fbe240sys/rpc clnt_vc.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+8-2sys/rpc/clnt_vc.c
+8-21 files

HardenedBSD/src 2f6e5e0lib/libpmc/pmu-events/arch/x86/amdzen4 data-fabric.json cache.json

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+1,090-0lib/libpmc/pmu-events/arch/x86/amdzen4/data-fabric.json
+828-0lib/libpmc/pmu-events/arch/x86/amdzen4/cache.json
+818-0lib/libpmc/pmu-events/arch/x86/amdzen4/floating-point.json
+418-0lib/libpmc/pmu-events/arch/x86/amdzen4/recommended.json
+174-0lib/libpmc/pmu-events/arch/x86/amdzen4/memory.json
+138-0lib/libpmc/pmu-events/arch/x86/amdzen4/other.json
+3,466-07 files not shown
+3,873-313 files

HardenedBSD/src 61c1fb1lib/libpmc/pmu-events/arch/x86/amdzen4 data-fabric.json cache.json

Merge branch 'freebsd/13-stable/main' into hardened/13-stable/master
DeltaFile
+1,090-0lib/libpmc/pmu-events/arch/x86/amdzen4/data-fabric.json
+828-0lib/libpmc/pmu-events/arch/x86/amdzen4/cache.json
+818-0lib/libpmc/pmu-events/arch/x86/amdzen4/floating-point.json
+418-0lib/libpmc/pmu-events/arch/x86/amdzen4/recommended.json
+174-0lib/libpmc/pmu-events/arch/x86/amdzen4/memory.json
+138-0lib/libpmc/pmu-events/arch/x86/amdzen4/other.json
+3,466-07 files not shown
+3,873-313 files

HardenedBSD/src 5da0bdbsys/dev/iicbus ds1307.c

ds1307(4): Fix a typo in a source code comment

- s/slighly/slightly/

(cherry picked from commit fa3b320668ba6068014337bbbb05dbd39ac8dfb6)
DeltaFile
+1-1sys/dev/iicbus/ds1307.c
+1-11 files

HardenedBSD/src 3f82081sys/i386/include atomic.h

i386: Fix a typo in a source code comment

- s/slighly/slightly/

(cherry picked from commit e6c45f377d5b3bc28fc51a67c40dfa45c2087895)
DeltaFile
+1-1sys/i386/include/atomic.h
+1-11 files

HardenedBSD/src 4f8ee76sys/dev/iicbus/rtc ds1307.c

ds1307(4): Fix a typo in a source code comment

- s/slighly/slightly/

(cherry picked from commit fa3b320668ba6068014337bbbb05dbd39ac8dfb6)
DeltaFile
+1-1sys/dev/iicbus/rtc/ds1307.c
+1-11 files

HardenedBSD/src 8ca6066sys/i386/include atomic.h

i386: Fix a typo in a source code comment

- s/slighly/slightly/

(cherry picked from commit e6c45f377d5b3bc28fc51a67c40dfa45c2087895)
DeltaFile
+1-1sys/i386/include/atomic.h
+1-11 files

HardenedBSD/src a36b9f2lib/libpmc/pmu-events/arch/x86/amdzen4 data-fabric.json cache.json

libpmc: Import AMD Zen 4 PMU events

MFC after:      1 week

(cherry picked from commit 278d6950943a9fec2bddb037b547c04a847c54ba)
DeltaFile
+1,090-0lib/libpmc/pmu-events/arch/x86/amdzen4/data-fabric.json
+828-0lib/libpmc/pmu-events/arch/x86/amdzen4/cache.json
+818-0lib/libpmc/pmu-events/arch/x86/amdzen4/floating-point.json
+418-0lib/libpmc/pmu-events/arch/x86/amdzen4/recommended.json
+174-0lib/libpmc/pmu-events/arch/x86/amdzen4/memory.json
+138-0lib/libpmc/pmu-events/arch/x86/amdzen4/other.json
+3,466-05 files not shown
+3,871-111 files

HardenedBSD/src 75f1323lib/libpmc/pmu-events/arch/x86/amdzen4 data-fabric.json cache.json

libpmc: Import AMD Zen 4 PMU events

MFC after:      1 week

(cherry picked from commit 278d6950943a9fec2bddb037b547c04a847c54ba)
DeltaFile
+1,090-0lib/libpmc/pmu-events/arch/x86/amdzen4/data-fabric.json
+828-0lib/libpmc/pmu-events/arch/x86/amdzen4/cache.json
+818-0lib/libpmc/pmu-events/arch/x86/amdzen4/floating-point.json
+418-0lib/libpmc/pmu-events/arch/x86/amdzen4/recommended.json
+174-0lib/libpmc/pmu-events/arch/x86/amdzen4/memory.json
+138-0lib/libpmc/pmu-events/arch/x86/amdzen4/other.json
+3,466-05 files not shown
+3,871-111 files

HardenedBSD/src 4ba444dsys/rpc clnt_vc.c

krpc: Ref cnt the client structures for TLS upcalls

A crash occurred during testing, where the client structures had
already been free'd when the upcall thread tried to lock them.

This patch acquires a reference count on both of the structures
and these are released when the upcall is done, so that the
structures cannot be free'd prematurely.  This happened because
the testing is done over a very slow vpn.

Found during a IETF bakeathon testing event this week.

MFC after:      5 days
DeltaFile
+8-2sys/rpc/clnt_vc.c
+8-21 files

HardenedBSD/src 877bd4elib/libgcc_s Symbol.map Versions.def

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+6-0lib/libgcc_s/Symbol.map
+3-0lib/libgcc_s/Versions.def
+9-02 files

HardenedBSD/src d5ad60blib/libgcc_s Symbol.map Versions.def

libgcc_s: expose __divmoddi4 on i386

GCC has used this for some time (since 7.0) and apparently we were
getting away with using the hidden symbol, but when linking with
--no-undefined-version we get an error unless it's properly exported.
(For anyone who wonders at the assymetry, __udivmoddi4 is indeed much
older and was introduced with GCC 3.0.)

MFC after:      3 days
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D44878

(cherry picked from commit 44e89340fe349abc020732958c6debd12b5adf2c)
DeltaFile
+6-0lib/libgcc_s/Symbol.map
+3-0lib/libgcc_s/Versions.def
+9-02 files

HardenedBSD/src 91e2461bin/date date.c, usr.bin/script script.c script.1

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+64-16usr.bin/script/script.c
+4-1usr.bin/script/script.1
+2-0bin/date/date.c
+70-173 files

HardenedBSD/src 8ceac8eusr.bin/script script.c script.1

script: handle terminal resize on SIGWINCH

Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:    des
Co-authored-by: Xavier Beaudouin <xavier.beaudouin at klarasystems.com>
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44167
DeltaFile
+54-8usr.bin/script/script.c
+4-1usr.bin/script/script.1
+58-92 files