FreeBSD/src adc02d5usr.bin/perror perror.c

perror(1): Capsicumise

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    markj, oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1492
DeltaFile
+7-0usr.bin/perror/perror.c
+7-01 files

FreeBSD/src 0963af5usr.bin/perror perror.c

perror: style nits
DeltaFile
+3-3usr.bin/perror/perror.c
+3-31 files

FreeBSD/src 4dd6597usr.bin/perror perror.c

perror(1): Replace magic exit codes with standard macros

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    markj, oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1492
DeltaFile
+4-4usr.bin/perror/perror.c
+4-41 files

FreeBSD/src 82e9f8cusr.bin/perror perror.c

perror(1): Reorder headers alphabetically to meet style(9) compliance

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    markj, oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1492
DeltaFile
+4-3usr.bin/perror/perror.c
+4-31 files

FreeBSD/src 08a38bbusr.bin/leave leave.c

leave: we should also cache time zone

MFC after:      1 week
DeltaFile
+1-0usr.bin/leave/leave.c
+1-01 files

FreeBSD/src 09ef538sys/dev/uart uart_dev_ns8250.c uart_dev_ns8250.h

uart: Add primitive noise filtering on RX

A long cable attached to the UART can act as an antenna if disconnected
from the other end.  This can cause noise on the receive side, possibly
as reflections from the transmit side, leading to an interrupt storm.
Filter this by adding a threshold of received characters without TX
ready, above which characters are dropped.  This is disabled by default,
but has been tested with a threshold of 1000+.  A high threshold is
recommended to avoid dropping characters during, for instance, a large
copy/paste from the other end.

Sponsored by:   Juniper Networks, Inc.
DeltaFile
+17-0sys/dev/uart/uart_dev_ns8250.c
+1-0sys/dev/uart/uart_dev_ns8250.h
+18-02 files

FreeBSD/src 24a7303usr.bin/leave leave.c

leave(1): Capsicumise

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1499
DeltaFile
+6-0usr.bin/leave/leave.c
+6-01 files

FreeBSD/src 11ba19dusr.bin/leave leave.c

leave: style nit
DeltaFile
+1-1usr.bin/leave/leave.c
+1-11 files

FreeBSD/src f7a6cf3usr.bin/leave leave.c

leave(1): Replace magic exit codes with standard macros

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1499
DeltaFile
+9-9usr.bin/leave/leave.c
+9-91 files

FreeBSD/src 93c80b7sys/netpfil/pf pf.c

pf: fix potential state key leak

If we fail to attach the new state keys in pf_state_key_attach() we are
expected to free both keys. Do so.
Note that in some scenarios both key are the same, so check for that
before freeing.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D47495

(cherry picked from commit 371bd29d4b22257a7e92e1e711cca3d94cfbd00d)
DeltaFile
+3-1sys/netpfil/pf/pf.c
+3-11 files

FreeBSD/src 95498a5usr.bin/colrm colrm.c

colrm(1): Capsicumise

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    markj, oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1496
DeltaFile
+6-0usr.bin/colrm/colrm.c
+6-01 files

FreeBSD/src fc26f24usr.bin/colrm colrm.c

colrm(1): Replace magic exit codes with standard macros

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by:    markj, oshogbo
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1496
DeltaFile
+6-7usr.bin/colrm/colrm.c
+6-71 files

FreeBSD/src 73cc716libexec/rtld-elf rtld.c

rtld: drop RTLD_INIT_PAGESIZES_EARLY

(cherry picked from commit 5bc24fd7a21ffd98fe978b4eb09a383c09edbe37)
DeltaFile
+0-7libexec/rtld-elf/rtld.c
+0-71 files

FreeBSD/src f3b371flibexec/nuageinit nuageinit

nuageinit: remove redundant mkdirs
DeltaFile
+0-2libexec/nuageinit/nuageinit
+0-21 files

FreeBSD/src 41fe9d5libexec/nuageinit nuageinit, libexec/nuageinit/tests nuageinit.sh

nuageinit: implement ssh_keys support

MFC After:      1 week
Sponsored by:   OVHCloud
DeltaFile
+56-0libexec/nuageinit/tests/nuageinit.sh
+37-5libexec/nuageinit/nuageinit
+93-52 files

FreeBSD/src fd630aesys/sys bio.h

vm: Retire an unused declaration

The bio_transient_map was long ago replaced by a vmem arena.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D47729
DeltaFile
+0-2sys/sys/bio.h
+0-21 files

FreeBSD/src b4b2e42sys/netpfil/pf pf.c

pf: fix potential state key leak

If we fail to attach the new state keys in pf_state_key_attach() we are
expected to free both keys. Do so.
Note that in some scenarios both key are the same, so check for that
before freeing.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D47495

(cherry picked from commit 371bd29d4b22257a7e92e1e711cca3d94cfbd00d)
DeltaFile
+3-1sys/netpfil/pf/pf.c
+3-11 files

FreeBSD/src 87a1f9esys/dev/e1000 if_em.c e1000_phy.c

e1000: Try auto-negotiation for fixed 100 or 10 configuration

This is a retread of https://reviews.freebsd.org/D34449 which I think
will fix the issue for the remote side not supporting autoneg.  We now
attempt an autoneg, and if that fails fall back to the current code
that forces the link speed/duplex.

The original intent of this patch is to inform the remote switch of
duplex settings when we (the client) are specifying a fixed 10 or 100
speed.  Otherwise it may get the duplex setting wrong.

The tricky case is when the remote (switch) side is fixing its
speed AND duplex while disabling autoneg and we (client) need to do
the same, which still seems to be common enough at some ISPs.

Original commit message follows:
Currently if an e1000 interface is set to a fixed media configuration,
for gigabit, it will participate in auto-negotiation as required by
IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration

    [37 lines not shown]
DeltaFile
+38-6sys/dev/e1000/if_em.c
+3-2sys/dev/e1000/e1000_phy.c
+41-82 files

FreeBSD/src 645c45esys/dev/e1000 if_em.c e1000_phy.c

e1000: Try auto-negotiation for fixed 100 or 10 configuration

This is a retread of https://reviews.freebsd.org/D34449 which I think
will fix the issue for the remote side not supporting autoneg.  We now
attempt an autoneg, and if that fails fall back to the current code
that forces the link speed/duplex.

The original intent of this patch is to inform the remote switch of
duplex settings when we (the client) are specifying a fixed 10 or 100
speed.  Otherwise it may get the duplex setting wrong.

The tricky case is when the remote (switch) side is fixing its
speed AND duplex while disabling autoneg and we (client) need to do
the same, which still seems to be common enough at some ISPs.

Original commit message follows:
Currently if an e1000 interface is set to a fixed media configuration,
for gigabit, it will participate in auto-negotiation as required by
IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration

    [37 lines not shown]
DeltaFile
+38-6sys/dev/e1000/if_em.c
+3-2sys/dev/e1000/e1000_phy.c
+41-82 files

FreeBSD/src 8b11cecsys/dev/igc if_igc.c

igc: disable hw.igc.sbp

Similar to 548d8a131d536d5f in e1000, disable this by default.

Sponsored by:   BBOX.io

(cherry picked from commit e80419da6cef3fb6ea1902bd9a250ca21072a42c)
DeltaFile
+2-2sys/dev/igc/if_igc.c
+2-21 files

FreeBSD/src 2f2938dsys/dev/e1000 em_txrx.c igb_txrx.c

e1000: Style txrx

Fix up indentation and reflow long lines.

Sponsored by:   BBOX.io

(cherry picked from commit 7390daf87c53073da5e74b2d73ac7320c1a44475)
DeltaFile
+34-21sys/dev/e1000/em_txrx.c
+26-18sys/dev/e1000/igb_txrx.c
+2-1sys/dev/e1000/if_em.c
+62-403 files

FreeBSD/src 987d564sys/dev/igc igc_txrx.c

igc: Style pass igc_txrx

Fix up indentation and reflow long lines.

MFC after:      3 days
Sponsored by:   BBOX.io

(cherry picked from commit c7fb7b5d9fcd1fc67794228820aa54df388d47b4)
DeltaFile
+27-18sys/dev/igc/igc_txrx.c
+27-181 files

FreeBSD/src 57b82desys/dev/ixgbe if_ix.c if_ixv.c

ix, ixv: fix kernel build

struct adapter was renamed to struct sc.

Reported by: FreeBSD User <freebsd at walstatt-de.de>

(cherry picked from commit 5ddb1aa3056305c202e604dd456fe0dcf365edd7)
DeltaFile
+1-1sys/dev/ixgbe/if_ix.c
+1-1sys/dev/ixgbe/if_ixv.c
+2-22 files

FreeBSD/src a6a48a9sys/dev/ixgbe if_ix.c

ix: remove stale comment

Reported by:    Navdeep Parhar

(cherry picked from commit 6ad2a9a64f34ea3b376c3064fcba30b3c8e654dd)
DeltaFile
+0-1sys/dev/ixgbe/if_ix.c
+0-11 files

FreeBSD/src ed4b2d1lib/libc/gen dlfcn.c, lib/libdl Symbol.map

_dl_iterate_phdr_locked(): fix libc and libdl

Add prototype.  Export from libdl.

Fixes:  1426fd6cff0603f0ee275b99f2ba35dc36f3d0c2
Reviewed by:    kevans
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 209fd89a2810419309944f10d11834321f0ebb25)
DeltaFile
+4-0lib/libdl/Symbol.map
+2-0lib/libc/gen/dlfcn.c
+6-02 files

FreeBSD/src 708106flib/libc/gen dlfcn.c Symbol.map, libexec/rtld-elf rtld.c Symbol.map

rtld: implement _dl_iterate_phdr_locked

Some sanitizers need to be able to use dl_iterate_phdr() after stopping
the rest of the process, but it's very hard to do so reliably as a
non-participant in the main logic of the program.

Introduce _dl_iterate_phdr_locked to bypass the locking that's normally
required for dl_iterate_phdr() and slap some scary warning on it.  It
will remain undocumented and probably shouldn't be used for anything
else.

Reviewed by:    kib

(cherry picked from commit 1426fd6cff0603f0ee275b99f2ba35dc36f3d0c2)
DeltaFile
+20-4lib/libc/gen/dlfcn.c
+24-0libexec/rtld-elf/rtld.c
+1-0libexec/rtld-elf/Symbol.map
+1-0lib/libc/gen/Symbol.map
+46-44 files

FreeBSD/src a4eee3fsys/dev/ixgbe ixgbe_osdep.c if_ix.c

ix, ixv: Update link status with autonegotiated baudrate value

Use autonegotiated link speed value while updating link status
to iflib.

This patch is part of change made in NetBSD kernel
by Masanobu Saitoh, NetBSD maintainer.

Differential Revision:  https://reviews.freebsd.org/D19176
Approved by:    erj

(cherry picked from commit a0302c9231502bae8f43edbd5fb8d73132eb8da7)
DeltaFile
+33-0sys/dev/ixgbe/ixgbe_osdep.c
+2-1sys/dev/ixgbe/if_ix.c
+1-1sys/dev/ixgbe/if_ixv.c
+2-0sys/dev/ixgbe/ixgbe.h
+38-24 files

FreeBSD/src 8de3ffcsys/dev/ixgbe if_ix.c ixgbe.h

ixgbe: Do not count L3/L4 checksum errors as input errors

NIC input errors have traditionally indicated problems at the link
level (crc errors, runts, etc).  People tend to build monitoring
infrastructure  around such errors in order to monitor for bad network
hardware. When L3/L4 checksum errors are included in the category of
input errors, it breaks such monitoring, as these errors can originate
anywhere on the internet, and do not necessarily indicate faulty
local network hardware.

Reviewed by: erj, glebius
Differential Revision: https://reviews.freebsd.org/D38346
Sponsored by: Netflix

(cherry picked from commit 8de48df35c3bf4800176b7aa54c75a01864d458b)
DeltaFile
+2-7sys/dev/ixgbe/if_ix.c
+0-1sys/dev/ixgbe/ixgbe.h
+2-82 files

FreeBSD/src de65f94sys/dev/ixgbe if_ix.c if_ixv.c

ixgbe: Style pass on FreeBSD part of driver

Fix up some indentation and reflow long lines

Sponsored by:   BBOX.io

(cherry picked from commit c58d34dd67a419866ee50f152044e49cecbae261)
DeltaFile
+484-341sys/dev/ixgbe/if_ix.c
+147-127sys/dev/ixgbe/if_ixv.c
+56-54sys/dev/ixgbe/if_bypass.c
+57-49sys/dev/ixgbe/ix_txrx.c
+30-29sys/dev/ixgbe/if_sriov.c
+12-12sys/dev/ixgbe/if_fdir.c
+786-6121 files not shown
+790-6167 files

FreeBSD/src d86afe4sys/dev/igc if_igc.c

igc: Reflow long lines

Sponsored by:   BBOX.io

(cherry picked from commit 9efc7325f1acb85ac8772096cc2b54fd0c6a60ff)
DeltaFile
+98-55sys/dev/igc/if_igc.c
+98-551 files