FreeBSD/src c0ec8ffshare/man/man7 stats.7

stats: Reference zpool-iostat(8) instead of zpool(8)

MFC after:      3 days
DeltaFile
+2-2share/man/man7/stats.7
+2-21 files

FreeBSD/src 233ece1usr.bin/stat stat.c, usr.bin/stat/tests stat_test.sh

stat: fix use of devname(3)

Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Reviewed by:    des, kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D56565

(cherry picked from commit 4d4acdbfc22c84081037f31cff4fb03d18373036)

stat: The devname test case requires root

Fixes:          4d4acdbfc22c ("stat: fix use of devname(3)")

    [24 lines not shown]
DeltaFile
+38-2usr.bin/stat/tests/stat_test.sh
+11-3usr.bin/stat/stat.c
+49-52 files

FreeBSD/src 7062e42usr.bin/stat/tests stat_test.sh

stat: Nits in stat tests

* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

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

(cherry picked from commit 8cbd3949297d56e3960dcde73bd7e2277ac4bee8)
DeltaFile
+13-12usr.bin/stat/tests/stat_test.sh
+13-121 files

FreeBSD/src 12f8971usr.bin/stat stat.c stat.1, usr.bin/stat/tests stat_test.sh

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D52481

(cherry picked from commit 1a7a067da456f8962ef87bfdf75c94cd12988615)
DeltaFile
+135-41usr.bin/stat/stat.c
+72-0usr.bin/stat/tests/stat_test.sh
+43-2usr.bin/stat/stat.1
+250-433 files

FreeBSD/src 6c2ea48usr.bin/stat/tests readlink_test.sh

stat: Nits in readlink tests

* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

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

(cherry picked from commit 1c793e7cbe2ecded388fd51fb20274891620a6f4)
DeltaFile
+6-3usr.bin/stat/tests/readlink_test.sh
+6-31 files

FreeBSD/src 62c1865sys/net80211 ieee80211_crypto.h

net80211: delete the deprecated ieee80211_wepkey struct

This hasn't been used in a long time, and since I am shuffling around
the net80211 crypto API a bunch, let's just delete it instead of
leaving it here and trying to figure out how to support it if it's
used by userland somehow.

Reviewed by:    guest-seuros
Differential Revision:  https://reviews.freebsd.org/D57312
DeltaFile
+0-8sys/net80211/ieee80211_crypto.h
+0-81 files

FreeBSD/src a653fd5sys/dev/malo if_malo.h, sys/dev/mwl if_mwl.c

net80211: create IEEE80211_KEYBUF_128_SIZE / IEEE80211_MICBUF_128_SIZE

The IEEE80211_KEYBUF_SIZE and IEEE80211_MICBUF_SIZE are sprinkled
throughout the net80211 stack, ioctl API and drivers.  This makes it
challenging to (eventually) up IEEE80211_KEYBUF_SIZE to support 256 /
384 bit encryption as, well, it'll break every single driver and the
ioctl API in doing so.

So as part of this, let's start to separate out the current key/mic
buffer size from what drivers and the ioctl layer are using.
Drivers especially shouldn't be using these definitions as their
key sizes are hardware / firmware API limits, not net80211 limits.
Ideally drivers would define their own key buffer / mic buffer
sizes and only copy in keys up to that length (and fail keys
that are too large) but the current net80211 API isn't there yet.

This doesn't yet change what defines / buffer sizes are used in the
ioctl layer.  I'm going to plan out some subsequent work to
separate out those defines and ioctl APIs so they maintain using

    [4 lines not shown]
DeltaFile
+18-2sys/net80211/ieee80211_crypto.h
+3-3sys/dev/malo/if_malo.h
+2-2sys/net80211/ieee80211_crypto_wep.c
+2-2sys/dev/mwl/if_mwl.c
+2-2sys/dev/ral/rt2560reg.h
+2-2sys/dev/usb/wlan/if_rsureg.h
+29-135 files not shown
+37-2111 files

FreeBSD/src c3d8acasys/net80211 DEFERRED_WORK.md README.md

net80211: add DEFERRED_WORK.md

Describe the ieee80211_task API, why its used and some of
its shortcomings.

Differential Revision:  https://reviews.freebsd.org/D57261
DeltaFile
+180-0sys/net80211/DEFERRED_WORK.md
+1-1sys/net80211/README.md
+181-12 files

FreeBSD/src 6a1e761release Makefile.vm

Makefile.vm: Split error condition

Make it clear which of two possible cases applies.

Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D56837

(cherry picked from commit 76d756eaa6823aad282cc53ec4e41a9777d89adc)
DeltaFile
+4-3release/Makefile.vm
+4-31 files

FreeBSD/src d09b42alibexec/rc rc, share/man/man8 rc.8

rc: Bail if /dev/null is not a device

On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.

PR:             295782
MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57447

(cherry picked from commit b5a96894f67a92f78f0641763eff1e0a46f2e036)
DeltaFile
+11-2share/man/man8/rc.8
+5-0libexec/rc/rc
+16-22 files

FreeBSD/src c8b81d5usr.sbin/etcupdate etcupdate.sh

etcupdate: Make diff -l actually work

While here, remove unnecessary blank lines.

MFC after:      1 week
Fixes:          6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by:    Boris Lytochkin <lytboris at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D57330

(cherry picked from commit a85e39030f8c7faa3d5a33373389440de6f0fff7)
DeltaFile
+4-14usr.sbin/etcupdate/etcupdate.sh
+4-141 files

FreeBSD/src d6800beusr.bin/limits limits.c

limits: Fix pipebuf resource type

* pipebuf is a size but is listed as a count

PR:             295623
MFC after:      1 week
Fixes:          f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57456

(cherry picked from commit ad524568f9fb77e270a22744d81b9cea0a2ab0eb)
DeltaFile
+1-1usr.bin/limits/limits.c
+1-11 files

FreeBSD/src 62f3971lib/libarchive Makefile.inc, usr.bin/bsdcat Makefile

libarchive: Clean up the build configuration

* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
  bsdunzip into libarchive's Makefile.inc.

* Drop some CFLAGS that merely duplicated some of the contents of our
  platform configuration header.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D57307

(cherry picked from commit eb3a0a74a069d0f294e1596504676459282bb308)

libarchive: Fix typo in sed command

MFC after:      1 week
Fixes:          eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by:    Shawn Webb <shawn.webb at hardenedbsd.org>

    [2 lines not shown]
DeltaFile
+5-13usr.bin/cpio/Makefile
+6-11usr.bin/bsdcat/Makefile
+11-5lib/libarchive/Makefile.inc
+6-8usr.bin/bsdcat/tests/Makefile
+6-8usr.bin/cpio/tests/Makefile
+4-10usr.bin/unzip/Makefile
+38-555 files not shown
+59-8611 files

FreeBSD/src 5c12023libexec/rc rc, share/man/man8 rc.8

rc: Bail if /dev/null is not a device

On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.

PR:             295782
MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57447

(cherry picked from commit b5a96894f67a92f78f0641763eff1e0a46f2e036)
DeltaFile
+11-1share/man/man8/rc.8
+5-0libexec/rc/rc
+16-12 files

FreeBSD/src 0932e25lib/libarchive Makefile.inc, usr.bin/bsdcat Makefile

libarchive: Clean up the build configuration

* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
  bsdunzip into libarchive's Makefile.inc.

* Drop some CFLAGS that merely duplicated some of the contents of our
  platform configuration header.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D57307

(cherry picked from commit eb3a0a74a069d0f294e1596504676459282bb308)

libarchive: Fix typo in sed command

MFC after:      1 week
Fixes:          eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by:    Shawn Webb <shawn.webb at hardenedbsd.org>

    [2 lines not shown]
DeltaFile
+5-13usr.bin/cpio/Makefile
+6-11usr.bin/bsdcat/Makefile
+11-5lib/libarchive/Makefile.inc
+7-8usr.bin/bsdcat/tests/Makefile
+7-8usr.bin/cpio/tests/Makefile
+4-10usr.bin/unzip/Makefile
+40-555 files not shown
+63-8611 files

FreeBSD/src f4744e7usr.bin/limits limits.c

limits: Fix pipebuf resource type

* pipebuf is a size but is listed as a count

PR:             295623
MFC after:      1 week
Fixes:          f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57456

(cherry picked from commit ad524568f9fb77e270a22744d81b9cea0a2ab0eb)
DeltaFile
+1-1usr.bin/limits/limits.c
+1-11 files

FreeBSD/src 70dfaf4usr.sbin/etcupdate etcupdate.sh

etcupdate: Make diff -l actually work

While here, remove unnecessary blank lines.

MFC after:      1 week
Fixes:          6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by:    Boris Lytochkin <lytboris at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D57330

(cherry picked from commit a85e39030f8c7faa3d5a33373389440de6f0fff7)
DeltaFile
+4-14usr.sbin/etcupdate/etcupdate.sh
+4-141 files

FreeBSD/src 2ff705fsys/netinet/libalias alias_db.c

libalias: Serialize updates to the global instance list

libalias maintains a global list of all libalias handles.  The list was
updated without any locking, but nothing prevents updates from running
concurrently.

MFC after:      1 week
DeltaFile
+17-0sys/netinet/libalias/alias_db.c
+17-01 files

FreeBSD/src acf0be6sys/netinet6 ip6_input.c

ip6: Drop dead code in ip6_input_hbh()

After commit 069a67374ed9, ip6_input() quickly rejects packets with
plen == 0, before ip6_input_hbh() is called.  So, there is no need to
check this condition again in the helper function.

Reviewed by:    pouria, zlei, tuexen
Differential Revision:  https://reviews.freebsd.org/D57342
DeltaFile
+4-16sys/netinet6/ip6_input.c
+4-161 files

FreeBSD/src 6cd8a1btests/sys/kern ptrace_test.c

tests/ptrace: Validate PT_SC_REMOTE with some tricky syscalls

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57485
DeltaFile
+215-0tests/sys/kern/ptrace_test.c
+215-01 files

FreeBSD/src c491c2dlib/libc/iconv iconv.3

iconv.3: Fix formatting of the error section

MFC after:      1 week
DeltaFile
+1-0lib/libc/iconv/iconv.3
+1-01 files

FreeBSD/src 5bd78cfcontrib/openbsm/bin/auditd auditd_fbsd.c auditd.c

auditd: Fix signal handling

Rewrite the main loop to use ppoll() instead of just blocking on read,
blocking the signals we care about when we aren't polling.

I didn't bother replacing alarm() with setitimer(); the alarm code
is dead anyway since there is no way for max_idletime to acquire a
non-zero value.

While here, avoid leaking the pid file and trigger descriptors to the
log child.

PR:             295840
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57451
DeltaFile
+39-40contrib/openbsm/bin/auditd/auditd_fbsd.c
+40-10contrib/openbsm/bin/auditd/auditd.c
+4-0contrib/openbsm/bin/auditd/audit_warn.c
+3-0contrib/openbsm/bin/auditd/auditd.h
+86-504 files

FreeBSD/src 05f132asbin/mount_udf mount_udf.8

mount_udf.8: Alphabetize and align options

While here, remove "The following UDF specific options are available:".
It is unused and does not appear to have ever been used.

MFC after:      3 days
DeltaFile
+5-6sbin/mount_udf/mount_udf.8
+5-61 files

FreeBSD/src 471fdd9sys/compat/linux linux_socket.c

linux: Fix sockopt copyout

The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D55881
DeltaFile
+14-3sys/compat/linux/linux_socket.c
+14-31 files

FreeBSD/src ea3426blibexec/nuageinit nuageinit.7 nuage.lua

nuageinit: Create parent directories in write_files

Currently, 'write_files' does not create parent directories, and
'runcmd' cannot be used here, since those scripts run after the files
have been written. The only workaround is to create the files in an
existing directory, such as '/root' or '/tmp', and then move those
files using 'runcmd', but this is cumbersome when there are many files,
even if they are small.

With this change, nuageinit now creates the parent directories for each
file using the path field, which mimics the same behavior as in
cloud-init.

Permissions and ownership can also be configured using 'runcmd'.

Reviewed by:            bapt@
Approved by:            bapt@
Differential Revision:  https://reviews.freebsd.org/D57395
DeltaFile
+2-2libexec/nuageinit/nuageinit.7
+1-0libexec/nuageinit/nuage.lua
+3-22 files

FreeBSD/src b16c731sys/netpfil/ipfw ip_fw_nat.c

ipfw nat: Add assertion that mbuf is not a chain

Discarding m_free's return value will result in an mbuf leak if the mbuf
was in a chain.

In general we should use m_freem if the mbuf may be in a chain, or
assert that the return was NULL.  There will not be a chain here due to
m_megapullup, so add an assert.

Reviewed by:    ae
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57479
DeltaFile
+3-2sys/netpfil/ipfw/ip_fw_nat.c
+3-21 files

FreeBSD/src 36d4119lib/libc/posix1e acl_to_text_nfs4.c acl_id_to_name.c

acl_id_to_name.c: Fix printing of uids and gids

uid_t and gid_t are uint32_t (unsigned 32bit integers).
They are printed as signed integers when calling getfacl
(and other tools using the acl_to_text() libc function).
This causes uid/gids larger than 2G (214783648) to print
as negative numbers
- which causes problem with setfacl since the acl_from_text()
  libc function fails on negative numbers.

(cherry picked from commit 6e7c10c79deac3c6bb6ad3bd12c8e0ad68bb59f0)
DeltaFile
+2-2lib/libc/posix1e/acl_to_text_nfs4.c
+2-2lib/libc/posix1e/acl_id_to_name.c
+4-42 files

FreeBSD/src a2cfe53sys/compat/linux linux_fork.c linux_misc.c, sys/kern kern_exit.c kern_exec.c

exit1(9): do not deadlock if exit is called due to PT_SC_REMOTERQ

The remote syscall is executed in the context where debugger owns a
p_lock hold on the target.  Due to this, exit1() waiting for p_lock
going to zero, never happen.

Postpone the exit1() call to ast then, saving the provided rval and
signo in the struct proc.  Mark the async-exiting proc with the new
p_flag P_ASYNC_EXIT.

While p_xexit can be reused, p_xsig can be only set by actual exit1(),
otherwise it breaks the ptrace mechanism. Allocate a dedicated p_asig
for it.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57482
DeltaFile
+53-4sys/kern/kern_exit.c
+6-7sys/kern/kern_exec.c
+2-2sys/compat/linux/linux_fork.c
+2-2sys/compat/linux/linux_misc.c
+2-2sys/kern/kern_ucoredump.c
+3-1sys/sys/proc.h
+68-183 files not shown
+72-209 files

FreeBSD/src 9f37839usr.bin/procstat procstat_bin.c

procstat binary: do not skip pid if either path or osrel sysctls failed

PR:     295893
Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57493
DeltaFile
+5-3usr.bin/procstat/procstat_bin.c
+5-31 files

FreeBSD/src bfdc17cshare/mk src.opts.mk

src.opts.mk: Comment about CTF & DTRACE relationship

WITH_CTF enables building userland components with CTF, and not the ctf*
tools as one might expect.  The tools are actually included with the
DTRACE knob.  Add a comment where the dependency is handled, as this has
caused confusion.

Reported by:    ivy
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56977

(cherry picked from commit f6178451eea5b1ce6802fbb0e6eceb555c7b4841)
DeltaFile
+2-0share/mk/src.opts.mk
+2-01 files