FreeBSD/src 51c823alibarchive archive_read_support_format_rar.c archive_read_support_format_xar.c, libarchive/test test_read_format_xar_doublelink.c

Cherry-pick commits from libarchive to vendor/libarchive

 #2148 fix: OOB in rar delta filter (a1cb648d5)
 #2149 fix: OOB in rar audio filter (3006bc5d0)
 #2150 xar: Fix another infinite loop and expat error handling (b910cb70d)

Obtained from:          libarchive
Libarchive commits:     b910cb70d4c1b311c9d85cd536a6c91647c43df7
                        a1cb648d52f5b6d3f31184d9b6a7cbca628459b7
                        3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b
DeltaFile
+15-0libarchive/archive_read_support_format_rar.c
+6-2libarchive/archive_read_support_format_xar.c
+1-1libarchive/test/test_read_format_xar_doublelink.c
+22-33 files

FreeBSD/src eb07a26sys/kern kern_procctl.c

sys_procctl(): Make it clear that negative commands are invalid

An initial reading of the preamble of sys_procctl() gives the impression
that no test prevents a malicious user from passing a negative commands
index (in 'uap->com'), which is soon used as an index into the static
array procctl_cmds_info[].

However, a closer examination leads to the conclusion that the existing
code is technically correct.  Indeed, the comparison of 'uap->com' to
the nitems() expression, which expands to a ratio of sizeof(), leads to
a conversion of 'uap->com' to an 'unsigned int' as per Usual Arithmetic
Conversions/Integer Promotions applied by '<=', because sizeof() returns
'size_t' values, and we define 'size_t' as an equivalent of 'unsigned
int' (which is not mandated by the standard, the latter allowing, e.g.,
integers of lower ranks).

With this conversion, negative values of 'uap->com' are automatically
ruled-out since they are converted to very big unsigned integers which
are caught by the test.  An analysis of assembly code produced by LLVM

    [16 lines not shown]
DeltaFile
+1-1sys/kern/kern_procctl.c
+1-11 files

FreeBSD/src 2c24df8usr.bin/script script.c script.1

script: handle terminal resize on SIGWINCH

Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:    des
Co-authored-by: Xavier Beaudouin <xavier.beaudouin at klarasystems.com>
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.

(cherry picked from commit 8ceac8e13dccbe4e177c8f2f443b87b7d2e3edb3)
DeltaFile
+54-8usr.bin/script/script.c
+4-1usr.bin/script/script.1
+58-92 files

FreeBSD/src fb4c7bfusr.bin/script script.c

script: minor style improvements

Fix some nits pointed out by checkstyle9.pl in advance of functional
changes to script(1).

Reviewed by:    des
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.

(cherry picked from commit 4459abe334eb4dbd416fa8094a64afc065ccd1cc)
DeltaFile
+10-8usr.bin/script/script.c
+10-81 files

FreeBSD/src f224a2cusr.bin/script script.c script.1

script: handle terminal resize on SIGWINCH

Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:    des
Co-authored-by: Xavier Beaudouin <xavier.beaudouin at klarasystems.com>
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.

(cherry picked from commit 8ceac8e13dccbe4e177c8f2f443b87b7d2e3edb3)
DeltaFile
+54-8usr.bin/script/script.c
+4-1usr.bin/script/script.1
+58-92 files

FreeBSD/src 2a2cc22usr.bin/script script.c

script: minor style improvements

Fix some nits pointed out by checkstyle9.pl in advance of functional
changes to script(1).

Reviewed by:    des
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.

(cherry picked from commit 4459abe334eb4dbd416fa8094a64afc065ccd1cc)
DeltaFile
+10-8usr.bin/script/script.c
+10-81 files

FreeBSD/src d289382lib/libsys cap_rights_limit.2, share/man/man4 rights.4

rights.4: various corrections on capability rights

- A file descriptor obtained from accept(2), accept4(2) and openat(2)
  is not always assigned all capability rights.  Instead, it inherits
  capability rights from the "parent" socket/dir file descriptor.
- getdents(2) and getdirentries(2) requires CAP_READ.
- openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1207
DeltaFile
+15-6share/man/man4/rights.4
+7-5lib/libsys/cap_rights_limit.2
+22-112 files

FreeBSD/src 78444b5lib/geom/label glabel.8, sys/conf files

glabel: Add support for Linux swap

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1205
DeltaFile
+91-0sys/geom/label/g_label_swaplinux.c
+3-0lib/geom/label/glabel.8
+1-0sys/geom/label/g_label.h
+1-0sys/modules/geom/geom_label/Makefile
+1-0sys/geom/label/g_label.c
+1-0sys/conf/files
+98-06 files

FreeBSD/src 1b3c07b. UPDATING, lib/libbsm Makefile

package: move OpenBSM auditing into its own package

Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package.
Also move the runtime OpenBSM manual pages from libbsm into auditd so
they get installed with the right package.

Add an UPDATING entry noting the new packages.

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1197
DeltaFile
+10-1usr.sbin/auditd/Makefile
+0-6lib/libbsm/Makefile
+5-0UPDATING
+1-1libexec/rc/rc.d/Makefile
+2-0release/packages/Makefile.package
+1-0usr.sbin/auditdistd/Makefile
+19-84 files not shown
+23-810 files

FreeBSD/src 0c0a211usr.sbin/authpf Makefile

package: move authpf into the FreeBSD-pf package

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1198
DeltaFile
+1-0usr.sbin/authpf/Makefile
+1-01 files

FreeBSD/src 6b1d152. UPDATING

UPDATING: add entry for recent pkgbase changes

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1196
DeltaFile
+5-0UPDATING
+5-01 files

FreeBSD/src d94c991sbin/setkey setkey.c

setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+1-1sbin/setkey/setkey.c
+1-11 files

FreeBSD/src 70fad8asbin/ipf/common lexer.c, sbin/ipf/libipf facpri.c

ipf: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-2sbin/ipf/common/lexer.c
+2-2sbin/ipf/libipf/facpri.c
+5-42 files

FreeBSD/src 7028e63sbin/camcontrol epc.c zone.c

camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+5-6sbin/camcontrol/epc.c
+3-4sbin/camcontrol/zone.c
+2-2sbin/camcontrol/attrib.c
+10-123 files

FreeBSD/src c3c8161sbin/ipfw ipfw2.c dummynet.c

ipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+2-2sbin/ipfw/ipfw2.c
+2-2sbin/ipfw/dummynet.c
+4-42 files

FreeBSD/src b561d8fusr.sbin/zonectl zonectl.c

zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+2-2usr.sbin/zonectl/zonectl.c
+2-21 files

FreeBSD/src cbfd42cusr.sbin/wlandebug wlandebug.c

wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+2-2usr.sbin/wlandebug/wlandebug.c
+2-21 files

FreeBSD/src 4c6e656usr.sbin/rwhod rwhod.c

rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+1-1usr.sbin/rwhod/rwhod.c
+1-11 files

FreeBSD/src f93475cusr.sbin/pstat pstat.c

pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+1-1usr.sbin/pstat/pstat.c
+1-11 files

FreeBSD/src 67db7b4usr.sbin/ppp chat.h

ppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-1usr.sbin/ppp/chat.h
+3-11 files

FreeBSD/src abab59fusr.sbin/usbconfig usbconfig.c

usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+2-2usr.sbin/usbconfig/usbconfig.c
+2-21 files

FreeBSD/src bccbb2fusr.sbin/ndp ndp.c

ndp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+4-4usr.sbin/ndp/ndp.c
+4-41 files

FreeBSD/src 83409a9usr.sbin/moused moused.c

moused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-4usr.sbin/moused/moused.c
+3-41 files

FreeBSD/src 8f65dcdusr.sbin/ctld kernel.c

ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+2-2usr.sbin/ctld/kernel.c
+2-21 files

FreeBSD/src 2f8ea2fusr.sbin/ctladm ctladm.c

ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-3usr.sbin/ctladm/ctladm.c
+3-31 files

FreeBSD/src 8918cc9usr.sbin/btxld elfh.c

btxld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-3usr.sbin/btxld/elfh.c
+3-31 files

FreeBSD/src 338d9c3usr.sbin/kbdcontrol kbdcontrol.c

kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+1-1usr.sbin/kbdcontrol/kbdcontrol.c
+1-11 files

FreeBSD/src fdbf7causr.sbin/bluetooth/bthidcontrol sdp.c, usr.sbin/bluetooth/bthidd kbd.c

bluetooth: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+4-3usr.sbin/bluetooth/hccontrol/node.c
+3-3usr.sbin/bluetooth/bthidcontrol/sdp.c
+3-2usr.sbin/bluetooth/hccontrol/hccontrol.c
+3-2usr.sbin/bluetooth/sdpd/profile.c
+3-2usr.sbin/bluetooth/sdpcontrol/search.c
+3-2usr.sbin/bluetooth/bthidd/kbd.c
+19-143 files not shown
+25-179 files

FreeBSD/src d1d652cusr.sbin/rtadvctl rtadvctl.c

rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-3usr.sbin/rtadvctl/rtadvctl.c
+3-31 files

FreeBSD/src 93e96d6usr.sbin/rtadvd control.c control_server.c

rtadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
DeltaFile
+3-3usr.sbin/rtadvd/control.c
+2-2usr.sbin/rtadvd/control_server.c
+1-1usr.sbin/rtadvd/rtadvd.c
+1-1usr.sbin/rtadvd/if.c
+7-74 files