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

FreeBSD/src 4e5834f — sys/isa isa_if.m isavar.h

isa: Retire the ISAPNP option and related code

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

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60674
DeltaFile
+0-767sys/isa/pnp.c
+0-603sys/isa/pnpparse.c
+13-560sys/isa/isa_common.c
+0-245sys/isa/pnpreg.h
+0-47sys/isa/isavar.h
+2-22sys/isa/isa_if.m
+15-2,2446 files not shown
+15-2,28212 files

FreeBSD/src ff07dc9 — sys/modules Makefile

sys/modules: Consolidate amd64-only lists

Merge the previous amd64 || i386 list (which itself seemed to be split
into two arbitrary sub-groups) with the other amd64-only list into a
single, alphabetically-sorted list.

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D62017
DeltaFile
+76-75sys/modules/Makefile
+76-751 files

FreeBSD/src 6ace147 — sys/libkern quad.h udivmoddi4.c

sys/libkern: Remove [u]divmoddi4 libcalls

These were previously used by i386 but are no longer used.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61882
DeltaFile
+0-65sys/libkern/divmoddi4.c
+0-46sys/libkern/udivmoddi4.c
+0-2sys/libkern/quad.h
+0-1133 files

FreeBSD/src 952bb5d — sys/modules Makefile

sys/modules: Collapse a few lists with identical conditionals

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D62018
DeltaFile
+12-22sys/modules/Makefile
+12-221 files

FreeBSD/src d7deefe — sys/crypto/des/arch/i386 des_enc.S, sys/i386/i386 machdep.c pmap.c

Remove the i386 kernel and i386-only device drivers

This does not move any content from sys/x86 back to sys/amd64.  A
few machine headers that are now amd64-specific may make sense to
move in the future.

This also removes all references to DEV_APIC which was only optional
on i386 and previously forced on for amd64.  Now the #ifdef's are
removed and just assume DEV_APIC is always present.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D60671
DeltaFile
+0-10,585sys/i386/linux/linux_systrace_args.c
+0-6,484sys/i386/i386/pmap.c
+0-2,810sys/crypto/des/arch/i386/des_enc.S
+0-2,637sys/i386/linux/syscalls.master
+0-2,493sys/i386/linux/linux_proto.h
+0-1,866sys/i386/i386/machdep.c
+0-26,875425 files not shown
+508-70,733431 files

FreeBSD/src 75a747d — sys/crypto/ccp ccp_hardware.c, sys/dev/arcmsr arcmsr.c

sys: Remove PAE #ifdef's in drivers

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60672
DeltaFile
+0-5sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
+0-4sys/dev/arcmsr/arcmsr.c
+0-4sys/crypto/ccp/ccp_hardware.c
+0-133 files

FreeBSD/src 0307bad — sys/x86/x86 local_apic.c

x86 lapic: Assume amd64 values when setting IDT entries

Suggested by:   kib
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D60809
DeltaFile
+10-14sys/x86/x86/local_apic.c
+10-141 files

FreeBSD/src af767e4 — sys/x86/include apicvar.h

amd64: Close gap between the TLB shootdown and bitmap IPIs

Previously this gap was filled by multiple TLB shootdown IPIs on i386.

Suggested by:   kib
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D60808
DeltaFile
+1-1sys/x86/include/apicvar.h
+1-11 files

FreeBSD/src 6baa2c0 — share/man/man4 smp.4

smp.4: Drop COMPATIBILITY section

FreeBSD's kernel is now inherently SMP and it is supported on all
architectures.

Reviewed by:    ziaee, kib
Differential Revision:  https://reviews.freebsd.org/D61881
DeltaFile
+0-8share/man/man4/smp.4
+0-81 files

FreeBSD/src 7fede8c — sys/dev/bxe bxe_stats.c

bxe: Use __SIZEOF_LONG__ to compute BITS_PER_LONG

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60807
DeltaFile
+1-5sys/dev/bxe/bxe_stats.c
+1-51 files

FreeBSD/src 5c16b26 — usr.bin/kdump linux.c

kdump: Use types and constants from amd64 linux32 for Linux on i386

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D61350
DeltaFile
+7-3usr.bin/kdump/linux.c
+7-31 files

FreeBSD/src 5640776 — sys/crypto/via padlock_hash.c padlock.c

padlock: Remove architecture #ifdefs

This used to matter when PC98 was in the tree as this driver was
stubbed out for PC98, but since PC98's removal these #ifdefs are
always true since the driver is only compiled on x86 architectures.

Suggested by:   kib
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D60806
DeltaFile
+0-6sys/crypto/via/padlock.c
+0-2sys/crypto/via/padlock_hash.c
+0-82 files

FreeBSD/src 2a62595 — share/man/man4 vte.4, sys/dev/mii rdcphyreg.h rdcphy.c

vte: Remove the vte(4) driver

While the module for this driver is enabled on all architectures and
it is present in the MI NOTES, this driver supports a Fast Ethernet
MAC included in the 32-bit-only Vortex86 SoC.  It is not available as
a standalone part, so is not relevant on any architectures other than
i386.

The companion rdcphy(4) driver is removed as well as it was only used
by the same SoC.

Reported by:    imp
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D62016
DeltaFile
+0-2,070sys/dev/vte/if_vte.c
+0-346sys/dev/vte/if_vtereg.h
+0-231sys/dev/mii/rdcphy.c
+0-163sys/dev/vte/if_vtevar.h
+0-153share/man/man4/vte.4
+0-73sys/dev/mii/rdcphyreg.h
+0-3,0369 files not shown
+4-3,07015 files

FreeBSD/src 6bd1b87 — lib/libkvm kvm_i386.h

libkvm: Drop static assertions for the i386 backend

These constants are never going to change but can only be verified
while kernel support remains in the tree.  Remove the assertions in
preparation for removing kernel support.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61351
DeltaFile
+0-21lib/libkvm/kvm_i386.h
+0-211 files