FreeBSD/src f417e2a — libexec/pkg-serve pkg-serve.c, libexec/pkg-serve/tests pkg_serve_test.sh

pkg-serve: stat the opened descriptor instead of the path

Open first and fstat() that fd, so the file checked is the one served.
O_NONBLOCK avoids blocking on a FIFO.
DeltaFile
+19-8libexec/pkg-serve/pkg-serve.c
+20-0libexec/pkg-serve/tests/pkg_serve_test.sh
+39-82 files

FreeBSD/src 5b95226 — libexec/pkg-serve pkg-serve.c, libexec/pkg-serve/tests pkg_serve_test.sh

pkg-serve: do not leak whether a path exists

Report "ko: file not found" for non-regular files as well, so a
client cannot tell an existing path from a missing one.
DeltaFile
+20-4libexec/pkg-serve/tests/pkg_serve_test.sh
+1-1libexec/pkg-serve/pkg-serve.c
+21-52 files

FreeBSD/src 309650b — libexec/pkg-serve pkg-serve.8 pkg-serve.c, libexec/pkg-serve/tests pkg_serve_test.sh

pkg-serve: bound the command line length

getline(3) grows its buffer without limit, so a client could make the
process consume unbounded memory.  Read commands with a bounded
reader, drain and reject lines longer than MAXLINE with
"ko: command too long", and document the limit.
DeltaFile
+34-6libexec/pkg-serve/pkg-serve.c
+33-0libexec/pkg-serve/tests/pkg_serve_test.sh
+4-1libexec/pkg-serve/pkg-serve.8
+71-73 files

FreeBSD/src 243ac45 — lib/libfetch ftp.c

libfetch: Fix buffer overruns in FTP code

* When parsing the reply to a CWD, PWD, or CDUP command, if we ran out
  of space in the destination buffer, we would correctly terminate the
  loop, but then incorrectly see the remaining length as non-zero,
  causing us to write a terminating NUL one past the end of the buffer
  and report success instead of a protocol error.  Additionally, the
  code would fail to notice an improperly terminated pathname, and was
  hard to follow, so rewrite the entire loop.

* When comparing the current working directory to the intended working
  directory to calculate the minimal operation to get from one to the
  other, if the current working directory was an empty string, we would
  improperly read one byte below the start of the intended working
  directory.

MFC after:      1 week
Reported by:    Laam Alif at Ibteda Digital Library
Differential Revision:  https://reviews.freebsd.org/D61502
DeltaFile
+32-27lib/libfetch/ftp.c
+32-271 files

FreeBSD/src 1ddd5b3 — bin/pax getoldopt.c

pax(1): Preserve const qualifier on strchr(3) result

Signed-off-by: Amir Shakeri <amirmuhammadshk at gmail.com>
Reviewed by:    kfv, dteske
Approved by:    dteske (mentor)
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2565
DeltaFile
+1-1bin/pax/getoldopt.c
+1-11 files

FreeBSD/src 26b47fd — sys/powerpc/powerpc altivec.c

powerpc: save and restore VRSAVE with the vector state

VRSAVE was never saved or restored, although user code can write it
and the mcontext carries it, so every process saw the value the
previous process on that CPU had left there.

Two processes pinned to the same CPU and writing different values to
VRSAVE each read back the other's; each reads back its own now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61544
DeltaFile
+5-0sys/powerpc/powerpc/altivec.c
+5-01 files

FreeBSD/src 4b3364a — sys/powerpc/include cpufunc.h pcpu.h

powerpc: move get_pcpu() to machine/pcpu.h

Every other arch defines get_pcpu() in machine/pcpu.h, powerpc has it in
machine/cpufunc.h, which is entirely under _KERNEL. lsof includes
sys/systm.h without _KERNEL first on purpose, so on powerpc cpufunc.h
turns into an empty header and pcpup later expands to a call of an
undeclared get_pcpu(). Since sys/mount.h started pulling in sys/proc.h
this breaks the lsof build on powerpc64 and powerpc64le.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61305
DeltaFile
+0-10sys/powerpc/include/cpufunc.h
+10-0sys/powerpc/include/pcpu.h
+10-102 files

FreeBSD/src f586138 — sys/dev/sound/usb uaudio.c

snd_uaudio: Fix the MIDI TX round-robin

Nothing advances curr_cable, so umidi_bulk_write_callback() only
services cable 0, which is a problem on MIDI devices with more than one
jack.

Fixes:          039477d3e7e7 ("snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
DeltaFile
+2-1sys/dev/sound/usb/uaudio.c
+2-11 files

FreeBSD/src c8e7312 — sys/dev/usb usbdevs

usbdevs: Add HumanWare BrailleNote Apex IDs

Add the HumanWare vendor ID and the BrailleNote Apex
product ID to support the Apex 32 BT when configured
as a screen reader terminal in USB Client mode.

This device will also serve as the starting point for
developing the FreeBSD braille(4) subsystem.

Reviewed by:            emaste
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61624
DeltaFile
+4-0sys/dev/usb/usbdevs
+4-01 files

FreeBSD/src 5daad0b — sys/dev/iicbus/controller/twsi twsi.c

twsi: Wait for the bus to go idle before starting a transfer

The status register does not read as idle (0xf8) right after the
previous transfer ended and the module was disabled. On fast
(optimised) kernels the next transfer starts too early, sees a
different status and fails with EIO ("Bad status at start of
transfer").

On the Pine H64 this made the AXP805 write that disables the PHY
supply fail from awg_shutdown(), leaving the PHY powered and the
board hanging on warm reboot. Poll the status register for up to 1ms
before declaring the bus not idle.

Tested on:      Pine H64 (5 warm reboots with a NODEBUG kernel)
Fixes:  cb167e1ae954 ("twsi: do not attempt transfer if bus is not idle")
DeltaFile
+24-1sys/dev/iicbus/controller/twsi/twsi.c
+24-11 files

FreeBSD/src ab81ea5 — sys/arm64/arm64 pmap.c

arm64 pmap: combine L3C accessed bits in pmap_mincore()

The accessed bit may be set in only some of an L3C superpage's L3
PTEs.  However, when pmap_mincore() found an L3C mapping, it reported
the accessed state of the specified L3 PTE only, so mincore(2) could
fail to report MINCORE_REFERENCED for an L3C superpage that had been
accessed.  When the accessed bit is not set in the specified entry, use
pmap_load_l3c() to combine the accessed bits from all of the L3C
superpage's L3 PTEs.

(cherry picked from commit 3ba68f5c5dcc9a4bcd513c28efce29afdfcb76ff)
DeltaFile
+10-1sys/arm64/arm64/pmap.c
+10-11 files

FreeBSD/src ee9e945 — . .mailmap, share/misc committers-src.dot

committers-src: Add hayzam mentored by markj@ and emaste@

Approved by:    markj (mentor)
DeltaFile
+3-0share/misc/committers-src.dot
+1-0.mailmap
+4-02 files

FreeBSD/src 4ad4ddc — usr.sbin/bhyve pci_emul.h pci_emul.c

bhyve: Reject unsupported checkpoints before saving RAM

pci_snapshot() rejects devices without a pe_snapshot callback, but
vm_checkpoint() reaches that check only after truncating checkpoint
files, pausing the VM, and saving RAM and kernel state.

Check for unsupported PCI devices at the start of vm_checkpoint(),
before creating files or pausing the VM.  This preserves existing
checkpoint files when the request cannot succeed.  Add
pci_can_snapshot() so that the new check and pci_snapshot() use the
same test.

Reviewed by:    markj, kevans
Approved by:    markj (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61003
DeltaFile
+21-0usr.sbin/bhyve/snapshot.c
+8-1usr.sbin/bhyve/pci_emul.c
+1-0usr.sbin/bhyve/pci_emul.h
+30-13 files

FreeBSD/src 6ef72b6 — lib/libthr/thread thr_mutex.c

libthr mutex_self_lock(): handle signals and clock steps

(cherry picked from commit 1b4779eef93c6e3c9af1887b941d7700ef143951)
DeltaFile
+7-3lib/libthr/thread/thr_mutex.c
+7-31 files

FreeBSD/src 0cafd30 — lib/libthr/tests Makefile pthread_rwlock_clocklock_test.c

libthr: add tests for pthread_rwlock_clock{rd,wr}lock(3)

(cherry picked from commit 083b44ddc07c6e07bcf889aa1f38c240d9dc0fc6)
DeltaFile
+528-0lib/libthr/tests/pthread_rwlock_clocklock_test.c
+1-0lib/libthr/tests/Makefile
+529-02 files

FreeBSD/src e1710df — lib/libthr/tests Makefile pthread_mutex_clocklock_test.c

libthr: add tests for pthread_mutex_clocklock(3)

(cherry picked from commit 7689242d6bdf7f8633885795e6528f9d8f2f2428)
DeltaFile
+489-0lib/libthr/tests/pthread_mutex_clocklock_test.c
+1-0lib/libthr/tests/Makefile
+490-02 files

FreeBSD/src 9eafbee — contrib/netbsd-tests/lib/libpthread t_mutex.c

libthr: libpthread/t_mutex.c tests should expect EDEADLK

(cherry picked from commit be90f23d4a6c70cd829366612c53755b47c2986d)
DeltaFile
+6-4contrib/netbsd-tests/lib/libpthread/t_mutex.c
+6-41 files

FreeBSD/src d0d8362 — share/man/man3 Makefile pthread_mutex_timedlock.3

pthread_mutex_clocklock.3: document

(cherry picked from commit 1c08e2b915bf44dacd5b14ee8d8214ef40946c65)
DeltaFile
+58-12share/man/man3/pthread_mutex_timedlock.3
+1-0share/man/man3/Makefile
+59-122 files

FreeBSD/src a96b3d0 — share/man/man3 pthread_rwlock_timedwrlock.3 pthread_rwlock_timedrdlock.3

pthread_*_timed*lock.3: switch to .Fo/Fc

(cherry picked from commit a9b82d6ba374b022926fcb77a96f8f40df862a3a)
DeltaFile
+4-1share/man/man3/pthread_rwlock_timedwrlock.3
+4-1share/man/man3/pthread_rwlock_timedrdlock.3
+4-1share/man/man3/pthread_mutex_timedlock.3
+12-33 files

FreeBSD/src be04aa4 — share/man/man3 pthread_cond_timedwait.3

pthread_cond_timedwait.3: split STANDARDS and HISTORY

(cherry picked from commit b3a205cd689d5c6c20aad37a1407031363c16020)
DeltaFile
+5-2share/man/man3/pthread_cond_timedwait.3
+5-21 files

FreeBSD/src 829955f — share/man/man3 Makefile pthread_rwlock_timedwrlock.3

pthread_rwlock_clock{rd,wr}lock(3): document

(cherry picked from commit 522407f54078e986bca5a74c8335881c6a1afe81)
DeltaFile
+43-19share/man/man3/pthread_rwlock_timedwrlock.3
+43-19share/man/man3/pthread_rwlock_timedrdlock.3
+2-0share/man/man3/Makefile
+88-383 files

FreeBSD/src a2a7a3a — share/man/man3 pthread_cond_timedwait.3

pthread_cond_timedwait.3: list pthread_cond_clockwait as .Nm

(cherry picked from commit 29495576ed399b2fce2c12f62356a29dbaaa86f4)
DeltaFile
+2-1share/man/man3/pthread_cond_timedwait.3
+2-11 files

FreeBSD/src be6740d — include pthread.h, lib/libthr pthread.map

libthr: add pthread_rwlock_clock{rd,wr}lock(3)

(cherry picked from commit 5577567bd0d0c695c25ddb4ea32b8c8231d8b0fe)
DeltaFile
+34-8lib/libthr/thread/thr_rwlock.c
+8-6lib/libthr/thread/thr_umtx.c
+10-0include/pthread.h
+4-4lib/libthr/thread/thr_umtx.h
+2-0lib/libthr/pthread.map
+58-185 files

FreeBSD/src 4655558 — include pthread.h, lib/libthr pthread.map

libthr: add pthread_mutex_clocklock(3)

(cherry picked from commit b7c2db4c772ba3c61f4760eca011332c9c12da1c)
DeltaFile
+28-14lib/libthr/thread/thr_mutex.c
+3-3lib/libthr/thread/thr_umtx.c
+5-0include/pthread.h
+2-2lib/libthr/thread/thr_umtx.h
+1-0lib/libthr/pthread.map
+39-195 files

FreeBSD/src b4c8ab2 — lib/libthr/thread thr_mutex.c, share/man/man3 pthread_mutex_timedlock.3

pthread_mutex_timedlock(3): return EDEADLK on detected recursion attempt

(cherry picked from commit bf2939ea60872d7791987d1727798e90eb904279)
DeltaFile
+5-17lib/libthr/thread/thr_mutex.c
+1-1share/man/man3/pthread_mutex_timedlock.3
+6-182 files

FreeBSD/src ba5b331 — lib/libthr/thread thr_private.h

lib/libthr: add helper to check valid clockid to use with _umtx_op(2)

(cherry picked from commit 62e53516f73247d2ed80d8dc452f02d9a92575a0)
DeltaFile
+28-0lib/libthr/thread/thr_private.h
+28-01 files

FreeBSD/src dd6d349 — lib/libthr/thread thr_cond.c

pthread_cond_clockwait(3): explicitly reject unacceptable clockids

(cherry picked from commit 8331d5a2fe967016343fb4322f1ed73e55ff9655)
DeltaFile
+2-0lib/libthr/thread/thr_cond.c
+2-01 files

FreeBSD/src a9d7bc9 — lib/libthr/thread thr_cond.c

libthr cond_wait_user(): do not loop forever on clock error

(cherry picked from commit e81badcfc010268d4935f4b4d28ebdbc0faebe0f)
DeltaFile
+1-1lib/libthr/thread/thr_cond.c
+1-11 files

FreeBSD/src fb606db — sys/kern kern_umtx.c

umtxq_sleep(): do not wait forever for zero absolute timeouts

(cherry picked from commit 8c13acc68517f785df4b6c4b016dfd1c6f38c8cf)
DeltaFile
+9-0sys/kern/kern_umtx.c
+9-01 files

FreeBSD/src 2efa9b0 — sys/kern kern_umtx.c, sys/sys umtxvar.h

kern_umtx.c: validate clockid used for _umtx_op(2) timeouts

(cherry picked from commit 524f1bf7f9fd8d5d0eee48346d6c1adb0413f95c)
DeltaFile
+106-43sys/kern/kern_umtx.c
+1-1sys/sys/umtxvar.h
+107-442 files