FreeBSD/src 9de72afusr.sbin/bsdinstall/scripts jail auto

bsdinstall: restore the environment when restarting

It is possible to restart the installation process upon errors, when
installing normally through the `auto` script, or when installing a jail
with the `jail` script. However, some values obtained interactively from
the user or guessed by some scripts were kept in the environment when
restarting the process; this made it impossible to re-run some steps as
expected after the restart.

For instance, if a bad choice of mirror was made in the `mirrorselect`
phase, restarting the installer remembered the choice made, and would
never prompt for a different one again. Rebooting was then the only easy
way out of this situation.

This change restores a pre-defined list of environment variables when
restarting the installation process.

PR:             266987
Reviewed by:    emaste

    [3 lines not shown]
DeltaFile
+46-4usr.sbin/bsdinstall/scripts/jail
+33-0usr.sbin/bsdinstall/scripts/auto
+79-42 files

FreeBSD/src cf624ffsbin/ifconfig af_inet6.c, sbin/ifconfig/tests inet6.sh Makefile

ifconfig: reject netmask and broadcast for inet6

We don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig.  Handle this the
same way as af_link, by rejecting attempts to configure these
parameters.

PR:     286910
Reported by:    Hayzam Sherif <hayzam at alchemilla.io>
MFC after:      3 days
Reviewed by:    zlei, kevans, des, cy
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D50413

(cherry picked from commit 59ee9260e6bbcc3b5654126eed6e9490315c81f1)

ifconfig tests: remove incorrect #!

Fixes: 59ee9260e6bb ("ifconfig: reject netmask and broadcast for inet6")

    [5 lines not shown]
DeltaFile
+83-0sbin/ifconfig/tests/inet6.sh
+4-2sbin/ifconfig/tests/Makefile
+5-0sbin/ifconfig/af_inet6.c
+92-23 files

FreeBSD/src 59f18f8sys/net if_bridge.c

bridge: check allow_llz_overlap before member_ifaddrs

When adding a new interface to a bridge and allow_llz_overlap=0, which
is the default value, if_bridge checks if the interface has IPv6 link
local addresses assigned, and if it does, it calls in6_ifdetach() to
remove all IPv6 addresses from the interface.

This means it was possible to do this:

        % ifconfig bridge1 create inet6 -ifdisabled auto_linklocal up
        % ifconfig epair20 create inet6 -ifdisabled auto_linklocal up
        % ifconfig bridge1 addm epair20a

... with the result that the link-local address on epair20a would be
removed, then the interface would be added to the bridge.

If member_ifaddrs=0, which is also the default value, this no longer
works:


    [17 lines not shown]
DeltaFile
+20-19sys/net/if_bridge.c
+20-191 files

FreeBSD/src 7d88b0elibexec/rc rc.subr

rc.subr: remove the dependency on bsdconfig

rc.subr uses sysrc(8) for the 'enable' and 'disable' commands, which
means the entire rc(8) stack depends on bsdconfig.  Instead, provide a
minimal amount of rc.conf-editing functionality in rc.subr and use it to
implement these commands.

Reviewed by:    des, bapt
Approved by:    des (mentor)
Differential Revision:  https://reviews.freebsd.org/D50325

(cherry picked from commit f6328f052518d56c01f10e14cd9ef1f2675c01a4)
DeltaFile
+86-16libexec/rc/rc.subr
+86-161 files

FreeBSD/src 56da5c5sys/conf files NOTES

mac_do(4): allow compiling into kernel

The manual page says this is possible, but it's not.  Make it possible.

Reviewed by:    olce, kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D50451

(cherry picked from commit c8d8cac2a8479009bcdca6c0cb9852af514896f2)
DeltaFile
+2-1sys/conf/files
+1-0sys/conf/NOTES
+1-0sys/conf/options
+4-13 files

FreeBSD/src 1b9a53eusr.sbin/bsdinstall/scripts zfsboot

zfsboot: fix misuse of the phrase zpool

A pool is not a zpool.

Reviewed by:    jbh, ivy
Approved by:    des (mentor)
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1569

(cherry picked from commit f69afe4201ff33da0b3c3ca464a92e2e0b07ac43)
DeltaFile
+15-15usr.sbin/bsdinstall/scripts/zfsboot
+15-151 files

FreeBSD/src 66c2e68tools/test/stress2/misc pager_read_error.sh

stress2: Added a regression test
DeltaFile
+36-0tools/test/stress2/misc/pager_read_error.sh
+36-01 files

FreeBSD/src 08419bflibexec/rc/rc.d Makefile, usr.sbin Makefile

don't gate ctl{d,adm} behind MK_ISCSI

These are no longer specific to iSCSI; always build them.

Reviewed by:    kevans, jhb
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D50625
DeltaFile
+4-4libexec/rc/rc.d/Makefile
+3-1usr.sbin/Makefile
+7-52 files

FreeBSD/src c6f345busr.sbin/pkg FreeBSD.conf.latest FreeBSD.conf.quarterly

pkg/FreeBSD.conf: Fix comments to reflect -kmods

Now that this file lists two repositories, the text "to disable *this*
repository" no longer makes sense.  Also, expand the example to list
how to disable both FreeBSD and FreeBSD-kmods repositories.

Reported by:    Graham Perrin
MFC after:      3 days

(cherry picked from commit 955ab1a8f21ec1a662a87fc5e76e6d5690e09085)
DeltaFile
+3-2usr.sbin/pkg/FreeBSD.conf.latest
+3-2usr.sbin/pkg/FreeBSD.conf.quarterly
+6-42 files

FreeBSD/src 970a71esys/amd64/conf GENERIC, sys/conf options

Rename BLOW_KERNEL_WITH_EXTERR to BLOAT_KERNEL_WITH_EXTERR

Guessed by:     alc
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/amd64/conf/GENERIC
+1-1sys/conf/options
+1-1sys/sys/exterrvar.h
+3-33 files

FreeBSD/src bfe9e97sys/compat/freebsd32 freebsd32_systrace_args.c freebsd32_syscall.h, sys/kern systrace_args.c

Regen
DeltaFile
+30-0sys/kern/systrace_args.c
+30-0sys/compat/freebsd32/freebsd32_systrace_args.c
+7-0sys/sys/sysproto.h
+2-1sys/sys/syscall.h
+2-1sys/compat/freebsd32/freebsd32_syscall.h
+2-1sys/sys/syscall.mk
+73-36 files not shown
+81-312 files

FreeBSD/src a56fe70include exterr.h Makefile, lib/libc/gen uexterr_format.c uexterr_gettext.c

Provide user interface to retrieve reported extended errors

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+31-0lib/libc/gen/uexterr_format.c
+24-0lib/libc/gen/uexterr_gettext.c
+21-0include/exterr.h
+12-2lib/libthr/thread/thr_syscalls.c
+5-0lib/libc/include/libc_private.h
+2-1include/Makefile
+95-33 files not shown
+99-39 files

FreeBSD/src 8e8d306sys/amd64/conf GENERIC

amd64 GENERIC: enable bloating kernel with ext errors strings

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+1-0sys/amd64/conf/GENERIC
+1-01 files

FreeBSD/src b9c8a07lib/libc/gen uexterr_gettext.c Makefile.inc, lib/libthr/thread thr_create.c thr_init.c

C runtime: enable extended error reporting from kernel

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+15-0lib/libc/gen/uexterr_gettext.c
+4-0lib/libthr/thread/thr_create.c
+3-0lib/libthr/thread/thr_init.c
+3-0lib/libthr/thread/thr_private.h
+1-0lib/libc/gen/Makefile.inc
+26-05 files

FreeBSD/src 98af94cinclude unistd.h, lib/libc/gen sysconf.c

sysconf(3): add _SC_UEXTERR_LEN, the max length of the extended error string

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+3-0lib/libc/gen/sysconf.c
+2-0sys/sys/exterrvar.h
+1-0include/unistd.h
+6-03 files

FreeBSD/src d995dc9sys/vm vm_mmap.c

vm/vm_mmap.c: add two examples of using exterrors

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+8-3sys/vm/vm_mmap.c
+8-31 files

FreeBSD/src 92b393clib/libsys Symbol.sys.map

libsys: export exterrctl symbol

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+1-0lib/libsys/Symbol.sys.map
+1-01 files

FreeBSD/src 09dfe06sys/kern sys_generic.c syscalls.master, sys/sys exterrvar.h proc.h

kernel: copyout extended errors to userspace and add exterrctl(2) to control it

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+72-1sys/kern/sys_generic.c
+13-0sys/sys/exterrvar.h
+7-1sys/kern/syscalls.master
+4-0sys/kern/subr_syscall.c
+2-0sys/sys/proc.h
+1-0sys/kern/kern_fork.c
+99-22 files not shown
+101-28 files

FreeBSD/src 2761de0sys/conf options, sys/kern kern_thread.c

kern: add extended errors support

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+58-0sys/sys/exterrvar.h
+25-0sys/sys/_exterr.h
+18-0sys/sys/exterr_cat.h
+4-4sys/kern/kern_thread.c
+3-0sys/sys/proc.h
+1-0sys/conf/options
+109-46 files

FreeBSD/src 7212b37sys/compat/freebsd32 freebsd32.h, sys/kern kern_proc.c

kinfo_proc: report address of extended kernel error structure

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D50483
DeltaFile
+4-0sys/kern/kern_proc.c
+2-1sys/sys/user.h
+1-0sys/compat/freebsd32/freebsd32.h
+7-13 files

FreeBSD/src ab9c944sys/dev/sound/midi sequencer.c

sound: Deprecate the MIDI sequencer

The in-kernel MIDI sequencer is not used anymore, since this is done by
userland applications nowadays. It also contains bugs, and we are not
exactly sure how it works, or if it worked properly in the first place.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D50606

(cherry picked from commit 799105f53a9647f86dbf08456260d5850851b6f9)
DeltaFile
+4-0sys/dev/sound/midi/sequencer.c
+4-01 files

FreeBSD/src 7944a87sys/dev/drm2/ttm ttm_bo_vm.c

drm2/ttm: Add missing includes to fix arm TEGRA124 build

Fixes:  bcd85e0150c9 ("vm_page: make iter_insert() public")
DeltaFile
+3-1sys/dev/drm2/ttm/ttm_bo_vm.c
+3-11 files

FreeBSD/src 6dd1c06sys/vm vm_page.c

vm_page: use lookup_ge in grab_valid_iter()

To improve performance slightly, use vm_radix_iter_lookup_ge to skip
over several missing pages at once in grab_valid_iter().

Fix a case in which the function could return with the iterator
argument not reset after a lock release/reacquire.

Reviewed by:    alc, markj
Differential Revision:  https://reviews.freebsd.org/D50601
DeltaFile
+13-7sys/vm/vm_page.c
+13-71 files

FreeBSD/src 81df032bin/cp/tests cp_test.sh

cp: Improve to_root test case.

Since the bug we're testing involved path name construction, we don't
need to be root to test it; we can simply check the error message.

Fixes:          537fbf70f12b
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D50628
DeltaFile
+9-8bin/cp/tests/cp_test.sh
+9-81 files

FreeBSD/src 6d3d1fccontrib/netcat netcat.c nc.1

netcat: Allow service names to be used.

Someone should really do a vendor import, but it's non-trivial, as we
have local modifications.  In the meantime, here's a nine-year-old
upstream patch which allows service names to be used instead of port
numbers.

MFC after:      1 week
Obtained from:  OpenBSD
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D50348
DeltaFile
+29-13contrib/netcat/netcat.c
+3-3contrib/netcat/nc.1
+32-162 files

FreeBSD/src e3bc87asys/vm vm_pageout.c

vm_pageout: fix pageout_flush

A change just made to vm_pageout_flush wrongly dismissed the variable
'runlen' and used 'count' in its place, with the unintended
consequence of terminating the main loop of the function prematurely
when the first VM_PAGER_AGAIN pageout status was encountered.
Reintroduce that variable, so that the loop runs to completion.

Reported by:    alc
Reviewed by:    alc
Fixes:  f2a193a967e3 ("vm_pageout: reduce number of flush() params")
Differential Revision:  https://reviews.freebsd.org/D50622
DeltaFile
+5-3sys/vm/vm_pageout.c
+5-31 files

FreeBSD/src 3747329sys/contrib/openzfs/lib/libspl/include/sys abd_os.h abd_impl_os.h, sys/contrib/openzfs/lib/libzpool/include/sys abd_os.h

zfs: merge openzfs/zfs at e8e602d98

Notable upstream pull request merges:
 #17381 44e326689 events: include zio type in IO error reports
 #17395 008c9666e Set spa_final_txg in spa_unload()
 #17394 1bd225ed8 abd_os: move headers from libzpool to libspl
 #17399 5764e218b vdev_disk: remove classic IO submission
 #17400 b3b3cd1e4 vdev: skip faulting disks pending removal
 #17406 a38376b37 Rename zvol kernel module parameters sysctls on FreeBSD side
 #17407 2d33c8edb Make rewrite use Uncached I/O

Obtained from:  OpenZFS
OpenZFS commit: e8e602d987b01e7940f698d5fa2b00754609c74b
DeltaFile
+3-278sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c
+57-2sys/contrib/openzfs/man/man8/zpool-events.8
+17-35sys/contrib/openzfs/module/zfs/zio.c
+48-0sys/contrib/openzfs/lib/libspl/include/sys/abd_os.h
+0-48sys/contrib/openzfs/lib/libzpool/include/sys/abd_os.h
+42-0sys/contrib/openzfs/lib/libspl/include/sys/abd_impl_os.h
+167-36328 files not shown
+246-49034 files

FreeBSD/src 3556ffasys/kern kern_thr.c

kern_thr.c: fix typo

Fixes:  c25ddffc51a1e2c0e03fa
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/kern_thr.c
+1-11 files

FreeBSD/src c25ddffsys/kern kern_thr.c

thr_new(2): check param.flags for reserved bits

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+3-0sys/kern/kern_thr.c
+3-01 files

FreeBSD/src 3a94bbfsys/amd64/amd64 sys_machdep.c, sys/x86/include sysarch.h

amd64: Add AMD64_DISABLE_TLSBASE

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+6-0sys/amd64/amd64/sys_machdep.c
+1-0sys/x86/include/sysarch.h
+7-02 files