FreeBSD/src f5f924e — usr.bin/netstat inet.c

netstat: update descriptions of two hostcache counters

Remove "on close", as now these counters are updated more often.

Reported by:    llm-postcr
Fixes:          c72102583a9a7881c5f992408dad6440840a8650
DeltaFile
+4-4usr.bin/netstat/inet.c
+4-41 files

FreeBSD/src f981b3c — sys/ofed/drivers/infiniband/ulp/nfsclrdma clnt_rdma.c

clnt_rdma.c: Add EADDRNOTAVAIL and EHOSTUNREACH error handling

There was a testing report that showed an RDMA connection
attempt replied EADDRNOTAVAIL during a network partitioning.
This error was not being handled as one that required a retry
of the connection attempt.

This patch adds EADDRNOTAVAIL and EHOSTUNREACH errors as ones
that require another reconnect attempt.

I have not been able to reproduce the failure, but think this
patch should correct the problem.

Reported by:    Wafa Hamzah <wafah at nvidia.com>
MFC after:      1 month
Fixes:  80bee4d83637 ("nfsclrdma: Add code to support client side NFS over RDMA")
DeltaFile
+2-1sys/ofed/drivers/infiniband/ulp/nfsclrdma/clnt_rdma.c
+2-11 files

FreeBSD/src 8758499 — usr.sbin/traceroute6 traceroute6.c traceroute6.8

traceroute6: do not print an ECN report for an echo reply

packet_ok() takes the ECN bits from the IPv6 header quoted by an
ICMPv6 error message.  The destination answers an ICMPv6 probe (-I)
with an echo reply, which repeats the ICMPv6 data of the probe but not
its IPv6 header, so for that reply the main loop used whatever an
earlier packet had left in ecn.

With -E the ECN report for the destination therefore repeated the
bits quoted by an earlier ICMPv6 error.  If no ICMPv6 error had been
received before, because the destination is one hop away, the first
hops are skipped with -f or the routers on the path are silent, ecn
was still uninitialized:

        $ traceroute6 -E -I -n -q 1 ::1
        traceroute6 to ::1 (::1) from ::1, 64 hops max, 20 byte packets
         1  ::1  0.055 ms (ecn=bleached)

Print the ECN report only when there is a quoted header.  Document

    [9 lines not shown]
DeltaFile
+4-1usr.sbin/traceroute6/traceroute6.8
+3-1usr.sbin/traceroute6/traceroute6.c
+7-22 files

FreeBSD/src b09f9a9 — usr.sbin/traceroute traceroute.c traceroute.8

traceroute: do not use a stale or NULL quoted header with -E

packet_ok() points the global hip at the IP header quoted by an ICMP
error message and nothing resets it afterwards.  The destination
answers an ICMP probe (-I) with an echo reply, which repeats the ICMP
data of the probe but not its IP header, so for that reply the main
loop used whatever an earlier packet had left in hip.

With -E the ECN report for the destination was therefore read from
the payload of the echo reply.  If no ICMP error had been received
before, because the destination is one hop away, the first hops are
skipped with -f or the routers on the path are silent, hip was still
NULL and traceroute crashed:

        $ traceroute -E -I 127.0.0.1
        traceroute to 127.0.0.1 (127.0.0.1), 64 hops max, 48 byte packets
        Segmentation fault

With -D the stale quote was compared with the probe.

    [12 lines not shown]
DeltaFile
+4-1usr.sbin/traceroute/traceroute.c
+4-1usr.sbin/traceroute/traceroute.8
+8-22 files

FreeBSD/src b808b9d — . ObsoleteFiles.inc, sys/dev/cxgbe t4_sge.c

mbuf: declare mbuf hash types as distinct types, not flags

This refactors b06db8c9dafb to use language rather then a test case to
enforce correct use mbuf hash types.  Also it makes debugger
print readable values, when you look up an mbuf.

Reviewed by:            gallatin, kbowling
Differential Revision:  https://reviews.freebsd.org/D60987
DeltaFile
+30-34sys/sys/mbuf.h
+0-53tests/sys/sys/mbuf_test.c
+2-4sys/kern/uipc_mbuf.c
+3-0ObsoleteFiles.inc
+1-1sys/net/iflib.h
+1-1sys/dev/cxgbe/t4_sge.c
+37-933 files not shown
+39-949 files

FreeBSD/src c721025 — sys/netinet tcp_var.h tcp_output.c, sys/netinet/tcp_stacks rack.c

tcp: update the send/recv pipes in hostcache during connection lifetime

Modern browsers usually open multiple connections to a site and
connections that were created later now can benefit from host cache data
that was gathered by earlier (but still open) connection.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60733
DeltaFile
+15-0sys/netinet/tcp_hostcache.c
+2-0sys/netinet/tcp_stacks/rack.c
+2-0sys/netinet/tcp_input.c
+1-0sys/netinet/tcp_var.h
+1-0sys/netinet/tcp_output.c
+21-05 files

FreeBSD/src 25086c5 — sys/dev/hyperv/hvsock hv_sock.h hv_sock.c

hvsock: make protosw methods static

No functional change.
DeltaFile
+41-44sys/dev/hyperv/hvsock/hv_sock.c
+0-14sys/dev/hyperv/hvsock/hv_sock.h
+41-582 files

FreeBSD/src 95e115d — sys/netgraph/bluetooth/include ng_btsocket_l2cap.h, sys/netgraph/bluetooth/socket ng_btsocket.c ng_btsocket_l2cap_raw.c

bluetooth: remove stub method

pr_init() will set this method to official stub pr_send_notsupp().
DeltaFile
+0-14sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
+0-3sys/netgraph/bluetooth/include/ng_btsocket_l2cap.h
+0-1sys/netgraph/bluetooth/socket/ng_btsocket.c
+0-183 files

FreeBSD/src 27dbfb9 — sys/kern uipc_socket.c, sys/sys sockopt.h

sockets: garbage collect soopt_mcopyout()

It came from KAME and was a complement of soopt_mcopyin(), that
copied socket options passed by setsockopt(2) to mbufs.  It was
unused since f95d46333db63ce9df4e8a2ca8c5c09bc0edfe72 in 2003
also from KAME.
DeltaFile
+0-34sys/kern/uipc_socket.c
+0-1sys/sys/sockopt.h
+0-352 files

FreeBSD/src 05951ed — . ObsoleteFiles.inc

ObsoleteFiles.inc: augment if_vte.4 symlink removal

Reported by:    llm-postcr
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0ObsoleteFiles.inc
+1-01 files

FreeBSD/src 5ff429a — sys/compat/linux linux_fork.c

linux(4): do not give a CLONE_PARENT child to an exiting parent

An exiting process hands its children to their reapers, and the
children it is the reaper of stay with its zombie until it is reaped.
A reaper which stays with the zombie of its reaper parent can call
clone(CLONE_PARENT).  The new process then becomes the child of the
zombie, while the calling process, not the zombie, is its reaper.  When
the zombie is reaped, reaper_abandon_children() does not see the new
process, which is not on its reaplist, and leaves it with the freed or
reused struct proc as its parent.  The exit of the process locks and
signals that struct proc, and PT_ATTACH to it writes through its stale
sibling links.

Give the new process to its reaper instead when the parent of the
calling process is exiting, as the exit1() of the parent would do.  The
parent sets P_WEXIT before its exit1() takes proctree_lock to reparent
its children, so a request that misses the flag is handled there.

Reported by:    llm-postcr

    [3 lines not shown]
DeltaFile
+14-2sys/compat/linux/linux_fork.c
+14-21 files

FreeBSD/src 028dcdf — sys/kern sys_process.c

ptrace(2): refuse PT_TRACE_ME when the parent is exiting

The child of a reaper stays with the zombie of the reaper until the
zombie is reaped, and PT_TRACE_ME from the child makes the zombie its
debugger.  The child then stops at its next signal or execve(2) with no
debugger to continue it.  When the zombie is reaped,
reaper_abandon_children() reparents the still traced child to the new
reaper, and proc_reparent() links it onto the orphan list of the zombie
being freed.  proc_realparent() then returns the freed or reused struct
proc from wait(2) and on the exit of the new reaper.  Since
6a079e1d87f2, INVARIANTS kernels panic on the assertion in proc_reap()
instead.

An exiting process cannot trace, so fail PT_TRACE_ME with EPERM when
the parent has P_WEXIT set, as it is done when the parent is init.  The
parent sets P_WEXIT before its exit1() takes proctree_lock to untrace
its children, so a request that misses the flag is undone there.

Reported by:    llm-postcr

    [3 lines not shown]
DeltaFile
+9-1sys/kern/sys_process.c
+9-11 files

FreeBSD/src 6bd3a58 — sys/kern kern_exit.c

proc_reap(): assert that the reaped process has no children left

A zombie keeps only the children it is the reaper of, and
reaper_abandon_children() passes them on when the zombie is reaped.
Assert that no child is left behind with the freed struct proc as its
parent, as was possible with linux(4) clone(CLONE_PARENT).

Suggested by:   llm-postcr
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+2-0sys/kern/kern_exit.c
+2-01 files

FreeBSD/src 7cce593 — tests/sys/kern ptrace_test.c

tests/sys/kern/ptrace_test: reaper parent exits before PT_TRACE_ME

The child of a reaper stays with its zombie until the reaper is reaped.
Check that PT_TRACE_ME fails for it with EPERM, and that reaping the
reaper passes the child on to the test process, the next reaper up.

The result is checked before the reaper is reaped, and the child exits
right after the request, so that a kernel without the fix fails the
test instead of reaping a reaper with a traced child.

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

FreeBSD/src babaf12 — sys/net rtsock.c

rtsock: drop a notification whose sockaddr does not fit

rtsock_msg_mbuf() bounces every sockaddr through a struct
sockaddr_storage on the stack, and only a KASSERT checks that it
fits.  Without INVARIANTS, a larger sockaddr overflows the stack.

The callers pass only sockaddrs that the kernel built or checked, so
one that does not fit is a bug in the caller.

Also check at run time, as f3be7df50f0 did for rtsock_msg_buffer():
free the mbuf and return NULL, which every caller already handles
like a failed allocation.

Log the drop at LOG_DEBUG, as rt_xaddrs() does for an oversized
sockaddr from userland.  The message is compiled in but off by
default.  Setting net.route.debug.rtsock_debug_level to 7 shows which
message and sockaddr were dropped.

Reviewed by:    lytboris

    [4 lines not shown]
DeltaFile
+7-0sys/net/rtsock.c
+7-01 files

FreeBSD/src f801db3 — share/man/man4 Makefile

share/man/man4: do not install if_vte.4 symlink

Fixes:      2a625956abb1 ("vte: Remove the vte(4) driver")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+0-1share/man/man4/Makefile
+0-11 files

FreeBSD/src 6c5783d — tests/sys/netpfil/pf/ioctl validation.c

pf tests: fix return code for ioctl/validation:addrule

Fixes:  b65057a684ee ("pf: fix error handling in pf_ioctl_addrule()")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-1tests/sys/netpfil/pf/ioctl/validation.c
+1-11 files

FreeBSD/src 7bda067 — sys/netpfil/pf pf_nl.c, tests/sys/netpfil/pf pfsync.sh

pf: fix displaying expired states

pf_state_expires() returns <= time_uptime for expired states. For such
states we should return a PF_ST_EXPIRE value of 0 to userspace.

We used to return the timestamp at which the state expired, which
resulted in nonsensical expiry times being printed. That in turn caused
the pfsync:expire_underflow test case to intermittently fail.

Adjust the test case to account for expired states now showing 'expires
in 00:00:00'.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+16-3tests/sys/netpfil/pf/pfsync.sh
+4-0sys/netpfil/pf/pf_nl.c
+20-32 files

FreeBSD/src 69a8b1b — sys/net pfvar.h, sys/netpfil/pf pf.c

pf: extend stricter checking for ICMPv6 packets

Now that we copy in the full MLD/ND packet we can sensibly inspect
their contents, and use them to generate more unique states for their
respective ICMPv6 packets.

Obtained From:  OpenBSD, mcbride <mcbride at openbsd.org> 70bf7555ef4c
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+18-2sys/netpfil/pf/pf.c
+1-1tests/sys/netpfil/pf/icmp6.sh
+2-0sys/net/pfvar.h
+21-33 files

FreeBSD/src 05d2b05 — sys/net if_ovpn.c

if_ovpn: defer freeing of struct ovpn_kkey_dir

These keys are used in the data path, but can be freed through control
operations such as OVPN_NEW_KEY and OVPN_DEL_KEY. That might cause us to
use a freed key while processing packets.
Avoid this by using epoch callbacks to free the keys. That means that
the key is guaranteed not to be freed until after we're done with any
packet that could be using it.

Reported by:    Kevin Day <kevin at your.org>
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+15-3sys/net/if_ovpn.c
+15-31 files

FreeBSD/src 6a079e1 — sys/kern kern_exit.c

reaper_abandon_children(): leave no orphans on a reaped reaper

A reaper which exited stays the reaper of its subtree until it is
reaped, and processes can be linked onto its orphan list after its
exit1() emptied it.  PT_ATTACH puts there a child which stayed with its
zombie reaper parent.  Since 38ab6d47b7cb, reaper_adopt() puts there a
traced process which the zombie gets when a subreaper is reaped.  When
the zombie is reaped in turn, reaper_abandon_children() keeps an orphan
holding a zombie reference with it, as is right only for
PROC_REAP_RELEASE.  The struct proc is freed with the orphan still
linked to it, and proc_realparent() returns the freed or reused struct
proc on PT_DETACH, on the exit of the debugger, and from wait(2).

When the reaper is reaped, pass every orphan on to the new reaper, as
its children are.  Anything linked onto the orphan list of a zombie
reaper is on its reaplist, so this empties the list.  Assert that in
proc_reap().

Reported by:    llm-postcr

    [4 lines not shown]
DeltaFile
+8-2sys/kern/kern_exit.c
+8-21 files

FreeBSD/src 162f76d — tests/sys/kern ptrace_test.c

tests/sys/kern/ptrace_test: reap a reaper which has a traced orphan

Add ptrace__parent_reaper_exits_before_attach, where the parent of the
traced child, also its reaper, exits before the attach.  The child stays
with the zombie, and the attach puts it on the orphan list of the
zombie.

Add ptrace__reaper_exits_before_subreaper, where the parent of the
traced child is a subreaper, and the reaper above it exits first.
Reaping the parent while the reaper is a zombie hands the child over to
the zombie, and links it onto the orphan list of the zombie.

In both tests, the test process then reaps the zombie, detaches from
the child, and waits for it.  Before the fix, the child stayed on the
orphan list of the freed reaper, and PT_DETACH handed it to the freed
struct proc.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+129-4tests/sys/kern/ptrace_test.c
+129-41 files

FreeBSD/src 9b9173c — libexec/rtld-elf/i386 reloc.c

rtld-elf/i386: assume CPUID is always present

It is on amd64 host.

Reviewed by:    jhb, markj
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D60693
DeltaFile
+0-22libexec/rtld-elf/i386/reloc.c
+0-221 files

FreeBSD/src 7afb1fc — lib/libc/csu/i386 reloc.c

libc/csu/i386: assume CPUID is always present

It is on amd64 host.

Reviewed by:    jhb, markj
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D60693
DeltaFile
+9-32lib/libc/csu/i386/reloc.c
+9-321 files

FreeBSD/src 0461ed3 — lib/msun/i387 fenv.c, lib/msun/x86 fenv.h

i386 lib/msun: SSE2 is always present on amd64 host

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D60703
DeltaFile
+26-79lib/msun/i387/fenv.c
+16-40lib/msun/x86/fenv.h
+42-1192 files

FreeBSD/src 0a56169 — sbin/ipfw ipfw.8, sys/netpfil/ipfw ip_fw2.c

ipfw: match tcpmss only on the first fragment

08f0a1bdc091 dropped the check that O_TCPMSS has a TCP header to look
at.  For a non-first fragment of a TCP datagram ulp is NULL, and
args->f_id._flags is not set for such a packet.  ipfw_check_packet()
does not zero its struct ip_fw_args, so the flags may still have
TH_SYN from an earlier packet; a tcpmss rule then reads the TCP
header through the NULL pointer and the kernel panics.

Check offset == 0, as the other TCP header opcodes do: then the TCP
header has been pulled up and the flags belong to this packet.

Document that tcpmss looks only at packets with the SYN flag set and
never matches a fragment with a non-zero offset.

Add tests that send SYNs through a tcpmss rule, alone and each
followed by a non-first TCP fragment, and check the rule counters:
  frag4: IPv4; panics without the fix.
  frag6: IPv6; panics without the fix.

    [8 lines not shown]
DeltaFile
+144-0tests/sys/netpfil/ipfw/tcpmss.sh
+7-2sbin/ipfw/ipfw.8
+1-1sys/netpfil/ipfw/ip_fw2.c
+1-0tests/sys/netpfil/ipfw/Makefile
+153-34 files

FreeBSD/src 52ff7f8 — . RELNOTES

RELNOTES: Add entries covering the removal of the i386 kernel

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D62019
DeltaFile
+23-0RELNOTES
+23-01 files

FreeBSD/src fb73a0c — tools/test/vm86 Makefile vm86_test_asm.s

tools: Remove the vm86 test tool

This requires an i386 kernel (virtual 8086 mode only works from 32-bit
protected mode, it is not supported by long mode).

Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D60676
DeltaFile
+0-120tools/test/vm86/vm86_test.c
+0-39tools/test/vm86/vm86_test_asm.s
+0-5tools/test/vm86/Makefile
+0-1643 files

FreeBSD/src 5574728 — sys/isa isa_common.h isa_common.c, sys/powerpc/mpc85xx isa.c

isa: Retire the isa_init() MD hook

The implementation was an empty function on all current platforms.

Reviewed by:    imp, kib, emaste
Differential Revision:  https://reviews.freebsd.org/D60675
DeltaFile
+0-5sys/x86/isa/isa.c
+0-5sys/powerpc/mpc85xx/isa.c
+0-1sys/isa/isa_common.h
+0-1sys/isa/isa_common.c
+0-124 files

FreeBSD/src 470a7ca — contrib/pnpinfo Makefile pnpinfo.8, usr.sbin/pnpinfo Makefile Makefile.depend

Retire the pnpinfo(8) utility

This was only enabled for i386 and is not relevant on modern hardware.
It was used to enumerate ISA add-on cards with configurable I/O
resources.

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D60673
DeltaFile
+0-607contrib/pnpinfo/pnpinfo.c
+0-74contrib/pnpinfo/pnpinfo.h
+0-57contrib/pnpinfo/pnpinfo.8
+0-14usr.sbin/pnpinfo/Makefile.depend
+0-10usr.sbin/pnpinfo/Makefile
+0-7contrib/pnpinfo/Makefile
+0-7693 files not shown
+4-7719 files