FreeBSD/src b00eb37. sqlite3.c shell.c, autosetup proj.tcl sqlite-config.tcl

sqlite3: Vendor import of sqlite3 3.53.1

Release notes at https://www.sqlite.org/releaselog/3_53_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3530100.tar.gz
DeltaFile
+11,180-5,219sqlite3.c
+9,171-5,882shell.c
+753-193sqlite3.h
+454-141autosetup/proj.tcl
+505-57tea/generic/tclsqlite3.c
+182-77autosetup/sqlite-config.tcl
+22,245-11,56919 files not shown
+22,595-11,83825 files

FreeBSD/src 123591eusr.sbin/lpr/lpd printjob.c

lpd: Style and whitespace cleanup

No functional change intended.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57186
DeltaFile
+92-99usr.sbin/lpr/lpd/printjob.c
+92-991 files

FreeBSD/src 0f3e148usr.sbin/lpr/lpd printjob.c

lpd: Fix issues reported by clang-analyzer

Also, unlink our temporary file if we fail to chmod it.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57185
DeltaFile
+20-19usr.sbin/lpr/lpd/printjob.c
+20-191 files

FreeBSD/src f2c7c5fusr.sbin/lpr/lpd printjob.c

lpd: Avoid buffer overflow when sending a job

When forwarding a print job to a remote server, we could overflow the
command buffer if a control or data file had a very long name.

MFC after:      1 week
Reported by:    Joshua Rogers <joshua at joshua.hu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57184
DeltaFile
+20-11usr.sbin/lpr/lpd/printjob.c
+20-111 files

FreeBSD/src 6047f6ausr.sbin/lpr/lpd lpd.8 lpd.c

lpd: Drop deprecated -p option

This alias for the -s option has been deprecated since 2002.  Time to
drop it from the documentation.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57183
DeltaFile
+1-10usr.sbin/lpr/lpd/lpd.8
+0-3usr.sbin/lpr/lpd/lpd.c
+1-132 files

FreeBSD/src c0cae7dusr.sbin/lpr/lpd lpd.c lpd.8

lpd: Restore ability to specify a port number

This has been broken since IPv6 support was added in 2000.  We would
validate the port number (which had to be a port number, but can now
also be a service name) and then ignore it.

MFC after:      1 week
Fixes:          08829865f659 ("IPv6 support for lpr.")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57181
DeltaFile
+9-19usr.sbin/lpr/lpd/lpd.c
+10-9usr.sbin/lpr/lpd/lpd.8
+19-282 files

FreeBSD/src 8e91778usr.sbin/lpr/lpd lpd.8

lpd: Reorder option list in manual page

MFC after:      1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57182
DeltaFile
+18-24usr.sbin/lpr/lpd/lpd.8
+18-241 files

FreeBSD/src 05e8f2blibexec/talkd announce.c, usr.bin/wall ttymsg.c wall.c

ttymsg: Overhaul

* Instead of an error string, return the usual 0 or -1 and let the caller
  figure out what, if anything, to tell the user.

* Avoid string manipulations by opening /dev first and using openat()
  with O_RESOLVE_BENEATH.

* Add a boolean argument which, if false, causes ttymsg() to return
  without sending the message if the tty's group-writable bit is not
  set.  This saves programs that respect this setting (like syslogd(8))
  from having to check before calling ttymsg().

* Update all callers.

The observable effect of this change is minimal except for slightly
different error messages when ttymsg() fails.  However, syslogd(8) will
no longer print spurious error messages on the console after trying and
failing to write a log message to an X11 session.

    [5 lines not shown]
DeltaFile
+64-56usr.bin/wall/ttymsg.c
+21-37usr.sbin/syslogd/syslogd_cap_log.c
+10-37usr.sbin/syslogd/syslogd.c
+4-4usr.sbin/syslogd/syslogd_cap.h
+3-3usr.bin/wall/wall.c
+2-1libexec/talkd/announce.c
+104-1382 files not shown
+106-1408 files

FreeBSD/src 33acf0fsys/netlink/route rt.c

netlink: Fix RTM_GETROUTE loop for RT_TABLE_UNSPEC

Reviewed by: bz, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57234
DeltaFile
+1-1sys/netlink/route/rt.c
+1-11 files

FreeBSD/src 151f097sys/kern subr_eventhandler.c

eventhandler: Fix the NODEBUG build

Reported by:    Michael Butler <imb at protected-networks.net>
Fixes:          735b16d490ae ("eventhandler: Fix a race when pruning eventhandlers")

(cherry picked from commit 3d8928114c4fec6cefbb1cd566ef8d1b3d2999e2)
DeltaFile
+3-1sys/kern/subr_eventhandler.c
+3-11 files

FreeBSD/src bc70af0sys/kern subr_eventhandler.c, sys/sys eventhandler.h

eventhandler: Fix a race when pruning eventhandlers

By default, eventhandler_deregister() blocks until it reaches some point
where no threads are invoking the event.  At this point, it knows that
1) no threads are currently executing the handler,
2) some thread has freed the eventhandler structure by virtue of having
   called eventhandler_prune_list(),
so it is safe to return.

Suppose a thread is trying to deregister an event handler.  A different
thread prunes it, and wakes up the first thread.  Before the first
thread runs, a third thread grabs the event handler lock, and starts
executing handlers.  The first thread observes el_runcount > 0, and goes
back to sleep.  The third thread sees no event handlers to prune, and
doesn't wake up the first thread, which sleeps forever.

This change fixes the race and tries to make eventhandler_invoke() more
efficient: keep a count of the number of dead list entries and only
prune the list if there is at least one dead entry.  Also, in

    [9 lines not shown]
DeltaFile
+14-4sys/kern/subr_eventhandler.c
+2-2sys/sys/eventhandler.h
+16-62 files

FreeBSD/src 473ba78sys/net if_vlan.c

if_vlan: Use the exclusive lock everywhere

Running sys/net tests in parallel reveals some panics which look like
the one below:

```
shared lock of (sx) vlan_sx @ /home/markj/sb/main/src/sys/net/if_vlan.c:2395
while exclusively locked from /home/markj/sb/main/src/sys/net/if_vlan.c:1850
panic: excl->share
cpuid = 9
time = 1776467219
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00d84e0780
vpanic() at vpanic+0x136/frame 0xfffffe00d84e08b0
panic() at panic+0x43/frame 0xfffffe00d84e0910
witness_checkorder() at witness_checkorder+0xdb1/frame 0xfffffe00d84e0ad0
_sx_slock_int() at _sx_slock_int+0x64/frame 0xfffffe00d84e0b10
vlan_ioctl() at vlan_ioctl+0x25c/frame 0xfffffe00d84e0b70
if_setflag() at if_setflag+0xdc/frame 0xfffffe00d84e0be0

    [29 lines not shown]
DeltaFile
+66-68sys/net/if_vlan.c
+66-681 files

FreeBSD/src deea28asys/amd64/vmm/io ppt.c

amd64/vmm: Fix ppt_unmap_mmio() after commit 36b855f18925

Fixes:          36b855f18925 ("amd64/vmm: Lock global PCI passthrough structures")
MFC after:      3 days
Reported by:    bz

(cherry picked from commit b133353310920aa823b1b5f83a308d0762f3bba3)
DeltaFile
+1-1sys/amd64/vmm/io/ppt.c
+1-11 files

FreeBSD/src f05fb51usr.bin/vtfontcvt vtfontcvt.c

vtfontcvt: Return error from write_fnt_source

Previously write_fnt_source always returned 0, silently discarding
errors.  Return rv so that errors set vtfontcvt's shell exit
appropriately.

Sponsored by: The FreeBSD Foundation
DeltaFile
+1-1usr.bin/vtfontcvt/vtfontcvt.c
+1-11 files

FreeBSD/src 21d9bc1lib/libcasper/services/cap_net cap_net.3

cap_net.3: Clarify monotonic reduction in permitted operations

Reviewed by:    markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57141

(cherry picked from commit 59601a75d6fb1300b1aec2977eaa6adeb0300684)
(cherry picked from commit 414617d82c8a4e10c8bdfc9ea50f3b3fde7cec0d)
DeltaFile
+2-1lib/libcasper/services/cap_net/cap_net.3
+2-11 files

FreeBSD/src 414617dlib/libcasper/services/cap_net cap_net.3

cap_net.3: Clarify monotonic reduction in permitted operations

Reviewed by:    markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57141

(cherry picked from commit 59601a75d6fb1300b1aec2977eaa6adeb0300684)
DeltaFile
+2-1lib/libcasper/services/cap_net/cap_net.3
+2-11 files

FreeBSD/src 7ba9229sbin/ipfw ipv6.c ipfw2.c, sbin/ipfw/tests test_add_rule.py

ipfw: treat ipv6 address with zero mask as 'any'

Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             294733
Differential Revision:  https://reviews.freebsd.org/D56618

(cherry picked from commit 2872268c7f6d473aae9b02ebb5d2c24fc2cff9b1)
DeltaFile
+24-0sbin/ipfw/tests/test_add_rule.py
+7-4sbin/ipfw/ipv6.c
+4-3sbin/ipfw/ipfw2.c
+2-0tests/atf_python/sys/netpfil/ipfw/insns.py
+37-74 files

FreeBSD/src 9acea8asbin/ipfw ipv6.c ipfw2.c, sbin/ipfw/tests test_add_rule.py

ipfw: treat ipv6 address with zero mask as 'any'

Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             294733
Differential Revision:  https://reviews.freebsd.org/D56618

(cherry picked from commit 2872268c7f6d473aae9b02ebb5d2c24fc2cff9b1)
DeltaFile
+24-0sbin/ipfw/tests/test_add_rule.py
+7-4sbin/ipfw/ipv6.c
+4-3sbin/ipfw/ipfw2.c
+2-0tests/atf_python/sys/netpfil/ipfw/insns.py
+37-74 files

FreeBSD/src 490c53esys/net80211 PROTOCOL.md DATAPATH_TRANSMIT.md, tools/kerneldoc/subsys Doxyfile-net80211

net80211: add initial README.md and PROTOCOL.md

* Add top level README.md, linking to in progress and todo items
* Add an 802.11 protocol overview, with todo items - this is designed
  to provide a basic introduction to 802.11 for people wishing to work
  on net80211 and drivers.
* DEBUG.md - cover the debug API
* DATAPATH_TRANSMIT.md - transmit datapath
* DATAPATH_RECEIVE.md - receive datapath
* PROTOCOL.md - a high level (for values of "high") overview of
  the 802.11 protocol and where it intersects with net80211

Differential Revision: https://reviews.freebsd.org/D56760
DeltaFile
+563-0sys/net80211/PROTOCOL.md
+390-0sys/net80211/DATAPATH_TRANSMIT.md
+160-0sys/net80211/DATAPATH_RECEIVE.md
+139-0sys/net80211/README.md
+101-0sys/net80211/DEBUG.md
+2-1tools/kerneldoc/subsys/Doxyfile-net80211
+1,355-16 files

FreeBSD/src 1ccaef9sys/net80211 ieee80211_vht.c

net80211: update/add some VHT doxygen documentation

Add and update some documentation to be picked up by doxygen.

Differential Revision: https://reviews.freebsd.org/D57079
DeltaFile
+54-17sys/net80211/ieee80211_vht.c
+54-171 files

FreeBSD/src 0c37c99sys/net80211 ieee80211_var.h

net80211: add some example doxygen inline documents

This isn't supposed to be comprehensive, I want to have examples
for the common doxygen comments:

* describing a struct
* inside a struct - single line before the item
* inside a struct - same line after an item
* inside a struct - multi-line before an item

These build fine with the doxygen build in tools/kerneldoc/subsys/ .

Differential Revision: https://reviews.freebsd.org/D57056
DeltaFile
+26-3sys/net80211/ieee80211_var.h
+26-31 files

FreeBSD/src e3b4dbbsys/dev/ath if_ath_tx.c, sys/net80211 ieee80211_ht.c ieee80211_ht.h

net80211: create ieee80211_ht_check_bar_exceed_retry_count()

Create a function to check if the BAR retry limit has been reached.
Use this in if_ath_tx instead of a hard-coded value.

I've been meaning to do this for a long time.

Differential Revision: https://reviews.freebsd.org/D57055
DeltaFile
+19-1sys/net80211/ieee80211_ht.c
+2-1sys/dev/ath/if_ath_tx.c
+2-0sys/net80211/ieee80211_ht.h
+23-23 files

FreeBSD/src cc145f5bin/sh/tests/builtins fc4.0 Makefile

sh/tests: Add a test for long line in history
DeltaFile
+27-0bin/sh/tests/builtins/fc4.0
+1-0bin/sh/tests/builtins/Makefile
+28-02 files

FreeBSD/src 95e4fcebin/sh input.c parser.c

bin/sh: Fix history long line truncation/corruption

When reading from standard input with editline history enabled, increase
buffer size to accomodate long lines so that history is recorded
correctly. Cleanup el_gets() handling avoiding potentially dangerous
retention of pointers to editline buffers across calls.  Ensure struct
parsefile objects are properly zero initialised when created. Remove
push argument from setinputstring() and simplify logic as it was always
called with a value of one and as was written was potentially dangerous
if ever called with a value of zero.

This commit does not fix long lines when history is enabled but editing
is not (e.g. if there is no terminal).

MFC after:      3 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2028
Signed-off-by: Kristofer Peterson <kris at tranception.com>
DeltaFile
+70-72bin/sh/input.c
+2-2bin/sh/parser.c
+1-1bin/sh/eval.c
+1-1bin/sh/input.h
+74-764 files

FreeBSD/src db513f3lib/libsys fcntl.2

fcntl.2: clarify arg use for F_SETFD

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57162
DeltaFile
+3-1lib/libsys/fcntl.2
+3-11 files

FreeBSD/src 09935bfsys/fs/tmpfs tmpfs_vfsops.c

tmpfs: Overhaul option handling on remount

On remount, we must accept all the same options as on initial mount.
For parameters which we're unable to modify on the fly, fail only if
the new value is different from the existing one.

PR:             295096
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57044

(cherry picked from commit 1cfc208a07b64a64377a4f8fe51c28f588a929cf)
DeltaFile
+62-38sys/fs/tmpfs/tmpfs_vfsops.c
+62-381 files

FreeBSD/src 0f4fd69sys/fs/tmpfs tmpfs_vfsops.c

tmpfs: Overhaul option handling on remount

On remount, we must accept all the same options as on initial mount.
For parameters which we're unable to modify on the fly, fail only if
the new value is different from the existing one.

PR:             295096
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57044

(cherry picked from commit 1cfc208a07b64a64377a4f8fe51c28f588a929cf)
DeltaFile
+62-38sys/fs/tmpfs/tmpfs_vfsops.c
+62-381 files

FreeBSD/src f3ded0fshare/man/man4 tcp.4, sys/netinet tcp_timewait.c tcp_var.h

tcp: Make RFC 6191 support configurable

Add a default-on per-VIMAGE sysctl for RFC 6191 connection recycling.
This makes it possible to merge the change to older branches where it
can be switched off by default to minimize risk.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
Reviewed by:    pouria, marius.h_lden.org, tuexen
Differential Revision:  https://reviews.freebsd.org/D57045

(cherry picked from commit 2af70d7a384934cee497fb6d75678e04f1416287)

tcp: Fix typo in RFC 6191 sysctl

Fixes:          2af70d7a3849 ("tcp: Make RFC 6191 support configurable")
MFC after:      1 week
Sponsored by:   Klara, Inc.

    [3 lines not shown]
DeltaFile
+37-21sys/netinet/tcp_timewait.c
+10-1share/man/man4/tcp.4
+2-0sys/netinet/tcp_var.h
+49-223 files

FreeBSD/src d2c2193stand/i386/pxeldr pxeboot.8, stand/libsa rpc.c

pxeboot: warn and abort on TCP-only NFS server, which doesn't work for pxeboot

When pxeboot gets a 0 as a port number from portmapper (indicating an
error), it currently happily sends NFS packets to the server's port 0
in an endless loop. Change this to instead bail out with a useful
message.

This happens, for example, with recent Linux NFS servers as many
distributions switched to TCP only NFS serving by default. FreeBSD's
pxeboot must have UDP. In this situation pxeboot asks the server's
portmapper for the UDP NFS port and since there is none gets 0.

Also add a hint to the manpage explaining this and how to fix it.

Reviewed by: ziaee, kevans, imp
DeltaFile
+8-0stand/i386/pxeldr/pxeboot.8
+5-0stand/libsa/rpc.c
+13-02 files

FreeBSD/src 11d69a4share/man/man4 linuxkpi_wlan.4, sys/compat/linuxkpi/common/src linuxkpi_80211_pm.c linux_80211.c

LinuxKPI: 802.11: add support for suspend/resume

Add support for automatic suspend/resume as we know it for wireless.
The problem is that the PCI driver which would normally gets the code
is the LinuxKPI PCI framework/Linux wireless driver, which we cannot
ammend or generally add extra suspend/resume code to.
A further problem is that with growing support, the LinuxKPI 802.11
(mac80211) layer also is involved in suspend/resume for WoWLAN (not
yet supported) meaning that we need to hook the suspend/resume
framework into that as well.  Unlike Linux we do not have a general
suspend/resume "hook" we can hang into and we need to tie this one
to the hardware so cannot indepedently (after the driver one) run it.

The solution for FreeBSD, in order to not mangle the Linux native
drivers and get extra maintanace overhead, is to add a bus child
which inherits the general framework and thus is 2 lines + #includes
for each driver extra to add to.

The general suspend/resume framework lives in LinuxKPI (linuxkpi_80211_pm)

    [35 lines not shown]
DeltaFile
+214-0sys/compat/linuxkpi/common/src/linuxkpi_80211_pm.c
+137-0sys/compat/linuxkpi/common/src/linux_80211.c
+116-0sys/compat/linuxkpi/common/src/linux_80211_macops.c
+15-1sys/compat/linuxkpi/common/src/linux_80211.h
+8-0sys/contrib/dev/rtw89/lkpi_rtw89_pm.c
+7-1share/man/man4/linuxkpi_wlan.4
+497-27 files not shown
+521-413 files