FreeBSD/src e61c4b8 — lib/libexecinfo/tests sigtramp_test.c

tests/sigtramp_test: re-enable test on aarch64

This now passes on both aarch64 (since 6a936d939b88)
and amd64. It still fails on other architectures, so
keep the xfail.

PR:             289096
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-6lib/libexecinfo/tests/sigtramp_test.c
+2-61 files

FreeBSD/src 138bce7 — usr.sbin/chroot chroot.8 chroot.c

chroot(8): add altroot mode

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+36-14usr.sbin/chroot/chroot.c
+25-0usr.sbin/chroot/chroot.8
+61-142 files

FreeBSD/src 25f21bb — sys/sys user.h

sys/user.h: make KF_FD_TYPE macros safer

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+6-6sys/sys/user.h
+6-61 files

FreeBSD/src c97671a — usr.bin/procstat procstat.1 procstat_files.c

procstat(1): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+1-1usr.bin/procstat/procstat.1
+2-0usr.bin/procstat/procstat_files.c
+3-12 files

FreeBSD/src face51f — usr.bin/fstat fuser.c fstat.c

fstat(1), fuser(1): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+4-1usr.bin/fstat/fuser.1
+4-1usr.bin/fstat/fstat.1
+2-0usr.bin/fstat/fstat.c
+1-0usr.bin/fstat/fuser.c
+11-24 files

FreeBSD/src f92ba77 — lib/libprocstat libprocstat.h libprocstat.c

libprocstat(3): teach about altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+9-0lib/libprocstat/libprocstat.c
+1-0lib/libprocstat/libprocstat.h
+10-02 files

FreeBSD/src 8cfae68 — sys/kern kern_descrip.c, sys/sys user.h

kinfo: export altroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-0sys/kern/kern_descrip.c
+1-0sys/sys/user.h
+8-02 files

FreeBSD/src 29691ec — lib/libsys cap_enter.2

cap_enter.2: document clearing altroot

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0lib/libsys/cap_enter.2
+2-01 files

FreeBSD/src dae40d1 — lib/libsys chroot.2

fchroot.2: document ENOTCAPABLE for O_RESOLVE_BENEATH

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+9-0lib/libsys/chroot.2
+9-01 files

FreeBSD/src 14016b7 — sys/compat/freebsd32 freebsd32_syscall.h freebsd32_systrace_args.c, sys/kern systrace_args.c

Regen
DeltaFile
+44-0sys/kern/systrace_args.c
+44-0sys/compat/freebsd32/freebsd32_systrace_args.c
+10-0sys/sys/sysproto.h
+3-1sys/sys/syscall.mk
+3-1sys/sys/syscall.h
+3-1sys/compat/freebsd32/freebsd32_syscall.h
+107-36 files not shown
+123-312 files

FreeBSD/src 9757c0c — sys/kern syscalls.master vfs_syscalls.c, sys/sys unistd.h

chaltroot(2) and fchaltroot(2): new syscalls

to change the altroot AKA ABI root for native processes

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+85-0sys/kern/vfs_syscalls.c
+10-0sys/kern/syscalls.master
+2-0sys/sys/unistd.h
+97-03 files

FreeBSD/src 06ec614 — sys/kern kern_descrip.c

pwd_altroot(9): expand herald comment

Requested and reviewed by:      markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+5-1sys/kern/kern_descrip.c
+5-11 files

FreeBSD/src 4333964 — sys/kern kern_descrip.c

pwd_altroot(): avoid creating new pwd structure if altroot does not change

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+13-16sys/kern/kern_descrip.c
+13-161 files

FreeBSD/src 06c455d — sys/compat/linux linux_util.c, sys/kern kern_descrip.c

vfs: guard against altroot pointing to not a directory

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-2sys/compat/linux/linux_util.c
+4-1sys/kern/kern_descrip.c
+1-1sys/sys/filedesc.h
+12-43 files

FreeBSD/src f2ee207 — include unistd.h, lib/libsys Symbol.sys.map

chaltroot(2)/fchaltroot(2): make accessible to userspace

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0lib/libsys/Symbol.sys.map
+2-0include/unistd.h
+4-02 files

FreeBSD/src e880b7a — sys/security/mac mac_framework.h mac_policy.h, sys/security/mac_stub mac_stub.c

mac(4): add vnode_check_chaltroot

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+18-0sys/security/mac/mac_vfs.c
+15-0sys/security/mac_test/mac_test.c
+9-0sys/security/mac_stub/mac_stub.c
+3-0sys/security/mac/mac_policy.h
+1-0sys/security/mac/mac_framework.h
+46-05 files

FreeBSD/src 3dac774 — sys/bsm audit_kevents.h, sys/security/audit audit_bsm.c

sys: add AUE_CHALTROOT and AUE_FCHALTROOT

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+2-0sys/security/audit/audit_bsm.c
+2-0sys/bsm/audit_kevents.h
+4-02 files

FreeBSD/src db5ea29 — sys/kern sys_capability.c

cap_enter(2): clear altroot when entering cap mode.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+5-0sys/kern/sys_capability.c
+5-01 files

FreeBSD/src 763f6cc — lib/libsys Makefile.sys chroot.2

chroot.2: document chaltroot(2)

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+111-17lib/libsys/chroot.2
+3-1lib/libsys/Makefile.sys
+114-182 files

FreeBSD/src 151a23f — sys/kern vfs_lookup.c

namei: disallow altroot for beneath lookups

Once namei_setup() has determined that the lookup is strictly relative,
set ni_rootdir to pwd_rdir and mark the lookup as already restarted,
which effectively disables restart on ENOENT.

This is done in namei_setup() and not in NDINIT(), because RBENEATH
might be set after NDINIT() by vn_open_cred() or inherited from
the dirfd in fgetvp_lookup(), and ISRESTARTED is cleared by
NDREINIT()/NDRESET().

Noted by:       markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+7-0sys/kern/vfs_lookup.c
+7-01 files

FreeBSD/src 2137bad — sys/kern kern_exec.c

exec_new_vmspace(): drop altroot for native processes if setuid

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60035
DeltaFile
+14-0sys/kern/kern_exec.c
+14-01 files

FreeBSD/src b5a5feb — lib/libsysdecode mktables

libsysdecode: Avoid non-portable \> word end boundary in mktables

Whilst we bootstrap our own sed when building on non-FreeBSD, it uses
the system regex(3) implementation, and so inherits its extensions, not
our own. Our implementation and glibc's both include this extension to
POSIX, but macOS's does not, and so even with our bootstrap sed we
cannot use the \> extension when built and run on macOS.

Unfortunately, there is no alternative form we can use; whilst macOS
implements [[:>:]] as an extension that provides this same feature, and
so do we, the regex(3) implementation in glibc does not, and the only
alternative glibc offers is \b, which neither us nor macOS implement.

We could make the form used conditional on the OS, but that starts to
get messy once other Linux libcs enter the picture, which in theory we
somewhat support.

Rewrite both uses to avoid the need for \>. For gen_table, use a pattern
to match the identifier that is precisely the (non-extended) C99

    [23 lines not shown]
DeltaFile
+2-2lib/libsysdecode/mktables
+2-21 files

FreeBSD/src 76212e6 — libexec/nuageinit/tests adduser.lua

nuageinit: Fix typo, whitespace, and lua style in new test

Fixes: e82b8378de19 ("nuageinit: Also add -n to pw usermod and pw groupshow")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-3libexec/nuageinit/tests/adduser.lua
+3-31 files

FreeBSD/src d5cbb62 — sys/compat/lindebugfs lindebugfs.c

lindebugfs: Do not expose a node before its private data is set

pfs_create_file(), pfs_create_dir() and pfs_create_link() link the new node
into its parent and return, and only then do the debugfs_create_*()
functions set pn_data.  Between the two, the node can already be found by a
lookup but pn_data is NULL, so a concurrent stat(2) or read(2) calls
debugfs_attr(), debugfs_fill() or debugfs_fill_data() which dereference it:
a driver creating debugfs entries while lindebugfs is mounted can panic
whoever is looking at the tree at that moment.  The window is only a few
instructions wide, which made it hard to hit; with a delay added on purpose
it panics at once in debugfs_attr() called from stat(2).

Changing pfs_create_*() to take the data would change the pseudofs API and
ABI.  Use the visibility callback instead: pseudofs checks it before
creating a vnode for a node and before getattr, read and write, so a
node whose pn_data is not set yet is reported as not visible and lookups
return ENOENT.  The data is published with a release store and read with an
acquire load, so whoever sees the pointer sees the initialized dentry_meta.
debugfs_lookup() now also returns NULL for such a node.

    [4 lines not shown]
DeltaFile
+33-8sys/compat/lindebugfs/lindebugfs.c
+33-81 files

FreeBSD/src 200b2fa — sys/dev/dwc dwc4_reg.h dwc4_dma.c

dwc: Limit the DMA of the QoS core to the address width of the hardware

The QoS core is used with the 64 bits descriptor address scheme, TDES1
and the *DLAR_HI registers holding the upper 32 bits.  This only works
when the core was synthesized with a wider than 32 bits address bus.  The
RK3568 GMAC for example has a 32 bits DMA: DMASBMR.EAME cannot be set and
the *DLAR_HI registers read back as zero.  The DMA tags allowed any
address, so on systems with memory above 4GB the descriptor rings and the
mbufs could be allocated there and the core fetched descriptors and data
from the truncated addresses.  Nothing could be sent or received.

Read the address width from the ADDR64 field of the MAC hardware feature 1
register, like Linux does, and limit the DMA tags to it.  Memory that
cannot be reached is bounced by busdma.

Tested on a Quartz64 Model A with 8GB of RAM and on a NanoPi R5S.

Reviewed by:    br
Differential Revision:  https://reviews.freebsd.org/D61018
DeltaFile
+22-4sys/dev/dwc/dwc4_dma.c
+2-0sys/dev/dwc/dwc4_reg.h
+24-42 files

FreeBSD/src d67880f — sys/dev/dwc if_dwc_rk.c

dwc: rockchip: Do not enable the same clock twice

Some Rockchip SoCs reference the same clock from several clock-names
properties.  On the RK3568 both mac_clk_tx and clk_mac_speed reference
the same clock: SCLK_GMAC0_RX_TX on GMAC0 and SCLK_GMAC1_RX_TX on
GMAC1.  So if_dwc_rk_init_clocks() enables that clock twice through two
different handles.

The clk framework then considers that the clock has more than one
consumer and refuses the rate change done by rk3568_set_speed() with
EBUSY, as the clock is not glitch-free.

Only enable clk_mac_speed if it is not the same clock as mac_clk_tx.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61016
DeltaFile
+10-1sys/dev/dwc/if_dwc_rk.c
+10-11 files

FreeBSD/src f23351e — sys/dev/dwc dwc4_dma.c

dwc: Program the DMA burst length of the QoS core

dma4_init() set the 8xPBL mode bit but never wrote the programmable burst
lengths, which stay at the reset value of one beat, so the DMA engines issue
very short bursts.  The TX and RX burst lengths are already parsed from the
device tree (snps,pbl, snps,txpbl, snps,rxpbl, default 8) for the older
core, use them here too.

Reviewed by:    br
Differential Revision:  https://reviews.freebsd.org/D60920
DeltaFile
+4-1sys/dev/dwc/dwc4_dma.c
+4-11 files

FreeBSD/src cfa0993 — sys/dev/dwc dwc4_core.c

dwc: Do not report a negative number of output errors with the QoS core

The good and the total transmitted packet counters are not read atomically,
so the difference can be negative when a packet completes between the two
reads.  It was added to the error counter as a huge unsigned value.  Only
add it when the total is larger.

Differential Revision:  https://reviews.freebsd.org/D60919
DeltaFile
+9-3sys/dev/dwc/dwc4_core.c
+9-31 files

FreeBSD/src 9c3faa7 — sys/dev/dwc if_dwcvar.h dwc4_dma.h

dwc: Configure the AXI request limits and mixed burst of the QoS core

dma4_init() wrote the system bus mode register with only the burst length
and enhanced address bits, which left the maximum number of outstanding AXI
requests at its reset value of one and did not honour mixed burst.  The
receive DMA could not keep up and dropped frames in the FIFO while the CPU
was mostly idle.

Parse the snps,axi-config node of the device tree (the maximum number of
outstanding read and write requests) with the other snps properties, and
program the limits, the hardware fields hold the limit minus one.  Set the
mixed burst bit when snps,mixed-burst is present, as the eqos driver does.

Differential Revision:  https://reviews.freebsd.org/D60918
DeltaFile
+16-0sys/dev/dwc/if_dwc.c
+9-0sys/dev/dwc/dwc4_dma.c
+4-0sys/dev/dwc/dwc4_dma.h
+2-0sys/dev/dwc/if_dwcvar.h
+31-04 files

FreeBSD/src 57f6320 — sys/conf files.arm64, sys/dev/dwc if_dwc_rk.c

dwc: rockchip: Add support for the RK3568 GMAC

The RK3568 GMAC is a DesignWare Ethernet QoS core (version 5.x), which dwc
supports since 9006a6ad1b30.  Add the SoC specific code:

- Select the GMAC0 or GMAC1 GRF registers from the device address, set the
  PHY interface and the RX/TX clock delays.
- Switch the RGMII speed clock according to the media (the device tree only
  selects the gigabit one).
- Compute the MDIO clock range from the main clock, the CSR clock of this
  core.
- Set DWC_HAS_GMAC5 so that the QoS backend is used.

eqos also matches this device, probe with a higher priority until it is
removed.

Differential Revision:  https://reviews.freebsd.org/D60917
DeltaFile
+155-3sys/dev/dwc/if_dwc_rk.c
+1-1sys/conf/files.arm64
+156-42 files