FreeBSD/src 8b70a20libexec/nuageinit nuage.lua nuageinit, libexec/nuageinit/tests nuageinit.sh

nuageinit: fix command injection and related issues

- Add shell_escape() helper to safely escape shell arguments
- Apply shell_escape to all user-controlled values in shell commands:
  adduser (usershow, useradd, lock, primary_group, groups)
  addgroup (groupshow, groupadd, members)
  exec_change_password (usermod)
  settimezone (tzsetup root and timezone)
  install_package (pkg package names)
- Escape double quotes in hostname when writing rc.conf.d/hostname
- Add missing 'local' declaration for resolvconf_command in nameservers()
- Escape interface name in resolvconf -a command
- Change open_resolvconf_conf() from 'w' to 'a' mode to prevent
  data loss when nameservers() is called multiple times
- Clean up stale resolvconf.conf at the start of each boot
  (skip on postnet to preserve config written by first call)

MFC After: 1 day
DeltaFile
+28-15libexec/nuageinit/nuage.lua
+15-2libexec/nuageinit/nuageinit
+3-3libexec/nuageinit/tests/nuageinit.sh
+46-203 files

FreeBSD/src 3d39eadsbin/ipfw ipfw2.c, sys/netpfil/ipfw ip_fw2.c

ipfw: fix IPv6 flow label matching

* do not require just only ip6 proto for flow-id opcode in ipfw(8).
  ipv6-icmp, tcp, udp should be fine too.
* fix off-by-one bug leading to out-of-bounds read.
* apply IPV6_FLOWLABEL_MASK before comparison in flow6id_match(),
  so flow-id opcode will match a specified flow label. No need to
  take protocol version and traffic class into account.
* add the test to verify that opcode is working correctly.

Reviewed by:    pouria
Obtained from:  Yandex LLC
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56869
DeltaFile
+78-0tests/sys/netpfil/ipfw/ipv6-flow-id.sh
+12-1tests/sys/netpfil/common/pft_ping.py
+1-4sbin/ipfw/ipfw2.c
+3-1sys/netpfil/ipfw/ip_fw2.c
+1-0tests/sys/netpfil/ipfw/Makefile
+95-65 files

FreeBSD/src 302545bsbin/fsck_msdosfs fat.c

fsck_msdosfs: fix FAT header correction not persisting in cache mode

When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty.  As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies.  Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.

Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.

Obtained from:  https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981

(cherry picked from commit 10e342c1ec78af5a0b97739c806b16a632118fa5)
DeltaFile
+11-0sbin/fsck_msdosfs/fat.c
+11-01 files

FreeBSD/src ae32d61sbin/fsck_msdosfs fat.c

fsck_msdosfs: fix FAT header correction not persisting in cache mode

When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty.  As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies.  Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.

Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.

Obtained from:  https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981

(cherry picked from commit 10e342c1ec78af5a0b97739c806b16a632118fa5)
DeltaFile
+11-0sbin/fsck_msdosfs/fat.c
+11-01 files

FreeBSD/src e26b5e0share/man/man4 spkr.4

spkr.4: Reflect latest changes and add history

- speaker(4) was recently modernized to lock the driver per-playback
  instead of per-open. Update the man page to explain this change.

- added a reference to MML and SMX in the historical context to make
  it easier for users to find additional documentation online.

Signed-off-by:  Raphael Poss <knz at thaumogen.net>
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/freebsd-src/pull/2183
DeltaFile
+78-24share/man/man4/spkr.4
+78-241 files

FreeBSD/src a3036edsys/net if_media.h

if_media: Claim 10BASE-T1S and 10BASE-T1L constants

These are two single-pair Ethernet (SPE) variants that run at 10 Mbps.
10BASE-T1S has automotive origins and supports multiple nodes on up to
25m of cable.  10BASE-T1L is intended for building and industrial
automation and supports long-distance point to point links of over 1km.

Reviewed by:    kbowling
Differential Revision: https://reviews.freebsd.org/D56952
DeltaFile
+6-0sys/net/if_media.h
+6-01 files

FreeBSD/src 7697e6csys/contrib/dev/acpica/common dmtbdump1.c, sys/contrib/dev/acpica/compiler dttable1.c aslexternal.c

acpica: Merge ACPICA 20260408

Merge commit '69ae37302ee98839857791a261546e19d078cdb8'
DeltaFile
+287-2sys/contrib/dev/acpica/include/actbl1.h
+125-11sys/contrib/dev/acpica/components/parser/psargs.c
+132-1sys/contrib/dev/acpica/compiler/dttable1.c
+110-1sys/contrib/dev/acpica/common/dmtbdump1.c
+104-1sys/contrib/dev/acpica/compiler/aslexternal.c
+45-12sys/contrib/dev/acpica/compiler/dttemplate.h
+803-28353 files not shown
+1,611-412359 files

FreeBSD/src 25942ddpackages Makefile, packages/smart smart.ucl Makefile

smart: Connect contrib/smart to build

Reviewed by:    fuz, jrm
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56638
DeltaFile
+30-0packages/smart/smart.ucl
+8-0usr.sbin/smart/Makefile
+4-0packages/smart/Makefile
+1-0packages/Makefile
+1-0usr.sbin/Makefile
+44-05 files

FreeBSD/src 7419d6econtrib/smart libsmart.c freebsd_dev.c

Add 'contrib/smart/' from commit 'eb3b1302382b1d0cbe37eeebabfcdd546aa2fc4e'

git-subtree-dir: contrib/smart
git-subtree-mainline: 95b4436e989df29f6368f13832cb13d7cbc52eac
git-subtree-split: eb3b1302382b1d0cbe37eeebabfcdd546aa2fc4e
DeltaFile
+1,359-0contrib/smart/libsmart.c
+828-0contrib/smart/freebsd_dev.c
+334-0contrib/smart/smart.c
+245-0contrib/smart/smart.8
+174-0contrib/smart/libsmart.h
+158-0contrib/smart/libsmart_desc.c
+3,098-06 files not shown
+3,379-012 files

FreeBSD/src 69ae373source/common dmtbdump1.c, source/compiler dttable1.c aslexternal.c

Import ACPICA 20260408
DeltaFile
+287-2source/include/actbl1.h
+142-4source/tools/acpisrc/astable.c
+125-11source/components/parser/psargs.c
+132-1source/compiler/dttable1.c
+110-1source/common/dmtbdump1.c
+104-1source/compiler/aslexternal.c
+900-20424 files not shown
+1,840-488430 files

FreeBSD/src 95b4436sys/compat/linuxkpi/common/src linux_acpi.c, sys/dev/acpica acpi.c

power: Rename sleep types

Make sleep type names clearer and more consistent, and allow space for
something like "os_hibernate" once that gets added to FreeBSD.

Reviewed by:    jaeyoon, olce, markj
Approved by:    jaeyoon, olce, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56920
DeltaFile
+8-8sys/dev/acpica/acpi.c
+5-5sys/sys/power.h
+4-4sys/kern/subr_power.c
+3-3sys/dev/xen/control/control.c
+2-2sys/dev/ufshci/ufshci_private.h
+1-1sys/compat/linuxkpi/common/src/linux_acpi.c
+23-236 files

FreeBSD/src 92f623eshare/man/man4 rge.4, sys/dev/rge if_rge.c if_rge_vendor.h

rge: add the Intel Killer E5000 PCI ID

This and the E3000 are both handled by the r8169 driver in Linux, and
reportedly this is infact just a straight re-brand of the RTL8126.

Tested by:      "Sinetek" on Discord
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56917
DeltaFile
+3-1share/man/man4/rge.4
+1-0sys/dev/rge/if_rge.c
+1-0sys/dev/rge/if_rge_vendor.h
+5-13 files

FreeBSD/src d64438alib/libc/regex regcomp.c, lib/libregex/tests gnuext.in

libregex: fix our mapping for \w

A small oversight in our implementation of \w is that it's actually
not strictly [[:alnum:]].  According to the GNU documentation, it's
actually [[:alnum:]] + underscore.  The fix is rather trivial: just add
it to our set explicitly, and amend our test set to be sure that _ is
actually included.

PR:             287396
(cherry picked from commit d0ff5773cefaf3fa41b1be3e44ca35bd9d5f68ee)
DeltaFile
+3-3lib/libregex/tests/gnuext.in
+1-0lib/libc/regex/regcomp.c
+4-32 files

FreeBSD/src 97cc6bdsys/dev/mana mana_en.c mana.h

mana: support jumbo packet size

Remove the restriction of up to 4k packet size. Now the driver
supports up to MJUM16BYTES size packets as long as hardware
supporting it.

Tested on VMs in Azure.

Tested by:      whu
MFC after:      1 week
Sponsored by:   Microsoft

(cherry picked from commit d0a2bd2765b365c4be9b17c29306f848953e55a5)
DeltaFile
+51-28sys/dev/mana/mana_en.c
+8-3sys/dev/mana/mana.h
+6-0sys/dev/mana/gdma.h
+65-313 files

FreeBSD/src b0f19adsys/dev/hyperv/netvsc if_hn.c

Hyper-V: hn: just call vf's ioctl when changing mtu

When changing mtu, if a vf is attached to the netvsc interface, just
calling its ioctl to change vf's mtu is good enough.

Tested by:      whu
MFC after:      3 days
Sponsored by:   Microsoft

(cherry picked from commit 44f656641c238cb3db31026f3e3bef36cd5231a8)
DeltaFile
+5-3sys/dev/hyperv/netvsc/if_hn.c
+5-31 files

FreeBSD/src bac7bd5sys/amd64/linux linux_locore.asm linux_support.S, sys/amd64/linux32 linux32_locore.asm linux32_support.S

linux: address executable stack warnings

Mark assembly files as not requiring executable stacks.

This still leaves linux32_vdso.so without a .note.GNU-stack section in
the gcc build for now.

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D56894
DeltaFile
+2-0sys/amd64/linux/linux_locore.asm
+2-0sys/amd64/linux/linux_support.S
+2-0sys/amd64/linux32/linux32_locore.asm
+2-0sys/amd64/linux32/linux32_support.S
+2-0sys/arm64/linux/linux_locore.asm
+2-0sys/arm64/linux/linux_support.S
+12-02 files not shown
+16-08 files

FreeBSD/src 70ef02bsys/net if_geneve.c

if_geneve: Fix uninitialized variable use in geneve_udp_input()

Set the ifp variable as soon as soft_c becomes available
so that interface statistics can be incremented.

PR:             295129
Reported by:    Robert Morris <rtm at lcs.mit.edu>
Fixes:          e44d2e941e8e ("if_geneve: Add Support for Geneve ...")
DeltaFile
+1-1sys/net/if_geneve.c
+1-11 files

FreeBSD/src ea72f6dsys/sys _decls.h cdefs.h, tools/build Makefile

sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h

There are situations where nothing from sys/cdefs.h is needed except for
the declaration braces.  More, the other facilities from sys/cdefs.h
might unnecessarly pollute the namespace.

Reviewed by:    markj, imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56889
DeltaFile
+46-0sys/sys/_decls.h
+1-7sys/sys/cdefs.h
+1-0tools/build/Makefile
+48-73 files

FreeBSD/src 32cf451sys/kern vfs_mount.c vfs_subr.c, sys/sys mount.h

vfs: convert vfs_op_thread_* macros to static inlines

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
DeltaFile
+55-36sys/sys/mount.h
+3-3sys/kern/vfs_mount.c
+3-3sys/kern/vfs_subr.c
+2-2sys/kern/vfs_vnops.c
+2-2sys/kern/vfs_cache.c
+65-465 files

FreeBSD/src e9a5eb0sys/kern vfs_subr.c

vop_read_pgcache_post(): report inotify IN_ACCESS same as for vop_read_post()

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
DeltaFile
+4-2sys/kern/vfs_subr.c
+4-21 files

FreeBSD/src 1d5e402sys/kern vfs_subr.c, sys/sys vnode.h mount.h

vnode: add VIRF_KNOTE flag

to indicate non-empty vnode knote list.  Use it instead of
VN_KNLIST_EMPTY() and guard note activations with it.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
DeltaFile
+12-17sys/sys/vnode.h
+10-4sys/kern/vfs_subr.c
+10-2sys/sys/mount.h
+32-233 files

FreeBSD/src a57420bsys/sys mount.h

vfs: convert VFS_OPs from macros to static inlines

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
DeltaFile
+109-97sys/sys/mount.h
+109-971 files

FreeBSD/src 5e4947fsys/sys vnode.h

sys/vnode.h: remove stale comment

The source sweep is not going to happen.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
DeltaFile
+0-1sys/sys/vnode.h
+0-11 files

FreeBSD/src 3085fc9lib/msun Makefile, lib/msun/man sqrt.3

[libm] implementation of rsqrt, rsqrtf, and rsqrtl

From the PR:
The attached diff implements the inverse square root function, i.e,
rsqrt(x) = 1 / sqrt(x).  Exhaustive testing of the float version
suggests that it is correctly rounded in round-to-nearest for all
test values in the range [0x1p-127,0x1p126].
Exhaustive testing of rsqrt and rsqrtl cannot be done, but 1100M
values of x for rsqrt and 400M values for rsqrtl were tested.  All
tested values were correctly rounded.

I do not have access to LD128 (i.e., IEEE 128-bit floating point)
hardware, so the implementation of rsqrtl() is untested.

The following is a summary of changes to source code.

* lib/msun/Makefile:
  . Add s_rsqrt.c and s_rsqrtf.c to COMMON_SRCS.
  . For non-53-bit long double targets, add s_rsqrtl.c to COMMON_SRCS.

    [31 lines not shown]
DeltaFile
+203-0lib/msun/src/s_rsqrtl.c
+155-0lib/msun/src/s_rsqrtf.c
+153-0lib/msun/src/s_rsqrt.c
+83-0lib/msun/src/math_private.h
+51-2lib/msun/man/sqrt.3
+3-3lib/msun/Makefile
+648-52 files not shown
+654-58 files

FreeBSD/src 0f92beelibexec/nuageinit/tests adddoas.lua nuage.sh

nuageinit: add adddoas tests
DeltaFile
+64-0libexec/nuageinit/tests/adddoas.lua
+7-0libexec/nuageinit/tests/nuage.sh
+1-0libexec/nuageinit/tests/Makefile
+72-03 files

FreeBSD/src 8b03193libexec/nuageinit/tests update_sshd_config.lua nuage.sh

nuageinit: add update_sshd_config tests
DeltaFile
+73-0libexec/nuageinit/tests/update_sshd_config.lua
+8-0libexec/nuageinit/tests/nuage.sh
+1-0libexec/nuageinit/tests/Makefile
+82-03 files

FreeBSD/src a49b3b1libexec/nuageinit/tests addsudo.lua nuage.sh

nuageinit: add addsudo tests
DeltaFile
+61-0libexec/nuageinit/tests/addsudo.lua
+7-0libexec/nuageinit/tests/nuage.sh
+1-0libexec/nuageinit/tests/Makefile
+69-03 files

FreeBSD/src 68fd0felibexec/nuageinit/tests decode_base64.lua nuage.sh

nuageinit: add decode_base64 tests
DeltaFile
+61-0libexec/nuageinit/tests/decode_base64.lua
+8-0libexec/nuageinit/tests/nuage.sh
+1-0libexec/nuageinit/tests/Makefile
+70-03 files

FreeBSD/src a2e0822include unistd.h, lib/libc/gen freadlink.c Makefile.inc

libc: add freadlink(3)

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
DeltaFile
+16-0lib/libc/gen/freadlink.c
+1-0include/unistd.h
+1-0lib/libc/gen/Makefile.inc
+1-0lib/libc/gen/Symbol.map
+19-04 files

FreeBSD/src 428da7dsys/sys fcntl.h

Add O_SYMLINK emulation

for MacOSX partial compatibility, defined as O_PATH | O_NOFOLLOW.
fstat(2) and freadlink(3) works on the resulting file descriptors,
but reads on the regular file do not.

More complete but more hackish version was developed but deemed too
hackish.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D56365
DeltaFile
+7-0sys/sys/fcntl.h
+7-01 files