OpenBSD cvs log

created 2019-11-17T13:46:24Z
begin 2019-11-07T00:00:00Z
end 2019-11-08T00:00:00Z
path src/sys
commits 25

date 2019-11-07T07:36:31Z
author dlg
files src/sys/net/bridgestp.c log diff annotate
src/sys/net/if.c log diff annotate
src/sys/net/if_aggr.c log diff annotate
src/sys/net/if_bpe.c log diff annotate
src/sys/net/if_bridge.h log diff annotate
src/sys/net/if_gre.c log diff annotate
src/sys/net/if_pfsync.c log diff annotate
message turn the linkstate hooks into a task list, like the detach hooks.

this is largely mechanical, except for carp. this moves the addition
of the carp link state hook after we're committed to using the new
interface as a carpdev. because the add can't fail, we avoid a
complicated unwind dance. also, this tweaks the carp linkstate hook
so it only updates the relevant carp interface, not all of the
carpdevs on the parent.

hrvoje popovski has tested an early version of this diff and it's
generally ok, but there's some splasserts that this diff fires that
i'll fix in an upcoming diff.

ok claudio@

date 2019-11-07T07:36:32Z
author dlg
files src/sys/net/if_tpmr.c log diff annotate
src/sys/net/if_trunk.c log diff annotate
src/sys/net/if_trunk.h log diff annotate
src/sys/net/if_var.h log diff annotate
src/sys/net/if_vlan.c log diff annotate
src/sys/net/if_vxlan.c log diff annotate
src/sys/netinet/ip_carp.c log diff annotate
message turn the linkstate hooks into a task list, like the detach hooks.

this is largely mechanical, except for carp. this moves the addition
of the carp link state hook after we're committed to using the new
interface as a carpdev. because the add can't fail, we avoid a
complicated unwind dance. also, this tweaks the carp linkstate hook
so it only updates the relevant carp interface, not all of the
carpdevs on the parent.

hrvoje popovski has tested an early version of this diff and it's
generally ok, but there's some splasserts that this diff fires that
i'll fix in an upcoming diff.

ok claudio@

date 2019-11-07T08:03:18Z
author dlg
files src/sys/net/if.c log diff annotate
message serialise hook adds and dels with a mutex instead of an implicit NET_LOCK.

i had NET_ASSERT_LOCKED() in the hook add and remove operations,
because that's what's held when the hooks are run. some callers do
not hold the NET_LOCK when calling them though, eg, bridge(4). aggr
and tpmr used to not hold NET_LOCK while being destroyed, which
also caused the asserts to fire, so i moved the port destroys inside
NET_LOCK, but now I have deadlocks with some barrier calls.

the hooks having their own lock means callers don't have to hold
NET_LOCK and the list will stay sane. the code that runs the hooks
gives up the mutex when calling the hook, but keeps track of where
it's up to bey putting a cursor in the list.

there's a single global mutex for all the interface linkstate and
detach hooks, but this stuff isn't a hot path by any stretch of the
imagination.

based on (a lot of) testing by hrvoje popovski. thank you.

date 2019-11-07T08:07:17Z
author dlg
files src/sys/net/if_aggr.c log diff annotate
src/sys/net/if_tpmr.c log diff annotate
message move the port destructor calls in clone destroy back out of NET_LOCK.

it's no longer necessary to hold NET_LOCK to call interface hook
adds or dels now, but it is necessary not to hold NET_LOCK when
calling some barrier functions.

found by hrvoje popovski

date 2019-11-07T10:51:46Z
author mpi
files src/sys/ddb/db_expr.c log diff annotate
message FALSE -> 0, missed in previous.

Spotted by deraadt@

date 2019-11-07T11:04:21Z
author mpi
files src/sys/arch/arm64/arm64/db_disasm.c log diff annotate
src/sys/arch/arm64/arm64/db_interface.c log diff annotate
src/sys/arch/arm64/arm64/db_trace.c log diff annotate
src/sys/arch/mips64/include/db_machdep.h log diff annotate
src/sys/arch/mips64/mips64/db_disasm.c log diff annotate
src/sys/arch/mips64/mips64/db_machdep.c log diff annotate
message Substitute boolean_t/TRUE/FALSE by int/1/0.

ok dlg@, jasper@

date 2019-11-07T11:16:55Z
author mpi
files src/sys/arch/alpha/alpha/db_disasm.c log diff annotate
src/sys/arch/alpha/alpha/db_interface.c log diff annotate
src/sys/arch/alpha/include/db_machdep.h log diff annotate
message ANSIfy & substitute boolean_t/TRUE/FALSE by int/1/0.

ok jasper@, deraadt@

date 2019-11-07T11:23:23Z
author krw
files src/sys/netinet/if_ether.c log diff annotate
message Avoid NULL dereference in arpinvalidate() and nd6_invalidate() by
making RTM_INVALIDATE code path perform same check as RTM_DELETE does.

ok mpi@

date 2019-11-07T11:23:24Z
author krw
files src/sys/netinet6/nd6.c log diff annotate
message Avoid NULL dereference in arpinvalidate() and nd6_invalidate() by
making RTM_INVALIDATE code path perform same check as RTM_DELETE does.

ok mpi@

date 2019-11-07T11:46:42Z
author dlg
files src/sys/net/if_pfsync.c log diff annotate
message remove the detach and linkstate hooks when the parent is going away.

i think this is a fix for a real bug. pfsync leaked the hooks it
had on a parent^Wsyncdev when the parent went away. now there's
KASSERTs to make sure all hooks are removed before an interface
goes away, the leak caused the KASSERTs to fire and made the bug
obvious.

found by hrvoje popovski

date 2019-11-07T11:55:02Z
author bluhm
files src/sys/dev/ic/an.c log diff annotate
message Only root is allowed to set the WEP key. Add an suser() check to
enforce this for the an(4) wireless network device.
found by Ilja Van Sprundel; OK dlg@ deraadt@ mpi@

date 2019-11-07T12:56:34Z
author bluhm
files src/sys/dev/ic/an.c log diff annotate
src/sys/dev/ic/if_wi.c log diff annotate
message Showing kernel WEP keys to userland has been disabled in generic
ieee80211 ioctl(2) implementation. Do the same for the driver
specific code of ac(4) and wi(4) wireless network devices.
OK mpi@

date 2019-11-07T13:16:25Z
author mpi
files src/sys/ddb/db_access.c log diff annotate
src/sys/ddb/db_access.h log diff annotate
src/sys/ddb/db_break.c log diff annotate
src/sys/ddb/db_break.h log diff annotate
src/sys/ddb/db_command.c log diff annotate
src/sys/ddb/db_command.h log diff annotate
src/sys/ddb/db_ctf.c log diff annotate
src/sys/ddb/db_elf.c log diff annotate
src/sys/ddb/db_examine.c log diff annotate
src/sys/ddb/db_expr.c log diff annotate
src/sys/ddb/db_extern.h log diff annotate
src/sys/ddb/db_interface.h log diff annotate
src/sys/ddb/db_run.c log diff annotate
src/sys/ddb/db_sym.c log diff annotate
src/sys/ddb/db_sym.h log diff annotate
src/sys/ddb/db_watch.c log diff annotate
src/sys/ddb/db_watch.h log diff annotate
message db_addr_t -> vaddr_t

ok deraadt@

date 2019-11-07T13:21:31Z
author mpi
files src/sys/arch/arm/arm/db_disasm.c log diff annotate
src/sys/arch/arm/arm/db_interface.c log diff annotate
src/sys/arch/arm/arm/db_trace.c log diff annotate
message Substitute boolean_t/TRUE/FALSE by int/1/0.

date 2019-11-07T13:25:44Z
author bluhm
files src/sys/netinet/in.c log diff annotate
message Do propper kernel input validation for in_control() ioctl(2)
SIOCGIFADDR, SIOCGIFNETMASK, SIOCGIFDSTADDR, SIOCGIFBRDADDR,
SIOCSIFADDR, SIOCSIFNETMASK, SIOCSIFDSTADDR, and SIOCSIFBRDADDR.
Name in_ioctl_set_ifaddr() consistently. Use in_sa2sin() to validate
inet address. Combine if_addrlist loops and add comment. Although
netmask is not a inet address, length must be valid.
Reported-by: [email protected]
OK visa@

date 2019-11-07T14:05:12Z
author mpi
files src/sys/kern/kern_timeout.c log diff annotate
message db_addr_t -> vaddr_t, missed in previous.

ok deraadt@

date 2019-11-07T14:44:52Z
author mpi
files src/sys/arch/alpha/alpha/db_disasm.c log diff annotate
src/sys/arch/alpha/alpha/db_interface.c log diff annotate
src/sys/arch/alpha/alpha/db_trace.c log diff annotate
src/sys/arch/alpha/include/db_machdep.h log diff annotate
src/sys/arch/amd64/amd64/db_disasm.c log diff annotate
src/sys/arch/amd64/amd64/db_trace.c log diff annotate
src/sys/arch/amd64/include/db_machdep.h log diff annotate
src/sys/arch/arm/arm/db_disasm.c log diff annotate
src/sys/arch/arm/arm/db_interface.c log diff annotate
src/sys/arch/arm/arm/db_trace.c log diff annotate
src/sys/arch/arm/include/db_machdep.h log diff annotate
src/sys/arch/arm64/arm64/db_interface.c log diff annotate
src/sys/arch/arm64/arm64/db_trace.c log diff annotate
src/sys/arch/arm64/include/db_machdep.h log diff annotate
src/sys/arch/hppa/hppa/db_disasm.c log diff annotate
src/sys/arch/hppa/hppa/db_interface.c log diff annotate
message Convert db_addr_t -> vaddr_t but leave the typedef for now.

date 2019-11-07T14:44:53Z
author mpi
files src/sys/arch/hppa/include/db_machdep.h log diff annotate
src/sys/arch/i386/i386/db_disasm.c log diff annotate
src/sys/arch/i386/i386/db_trace.c log diff annotate
src/sys/arch/i386/include/db_machdep.h log diff annotate
src/sys/arch/mips64/include/db_machdep.h log diff annotate
src/sys/arch/mips64/mips64/db_disasm.c log diff annotate
src/sys/arch/mips64/mips64/db_machdep.c log diff annotate
src/sys/arch/sparc64/include/db_machdep.h log diff annotate
src/sys/arch/sparc64/sparc64/db_disasm.c log diff annotate
src/sys/arch/sparc64/sparc64/db_interface.c log diff annotate
src/sys/arch/sparc64/sparc64/db_trace.c log diff annotate
message Convert db_addr_t -> vaddr_t but leave the typedef for now.

date 2019-11-07T14:49:07Z
author cheloha
files src/sys/kern/kern_time.c log diff annotate
message adjfreq(2): fix atomic swap

I broke adjfreq(2)'s atomic swap in kern_time.c,v1.112. By using the
"f" variable to store both the new and old frequency adjustments, the
new adjustment gets clobbered by the old adjustment if the caller asked
for a swap.

ok visa@ mpi@

date 2019-11-07T15:58:39Z
author mpi
files src/sys/arch/powerpc/ddb/db_disasm.c log diff annotate
src/sys/arch/powerpc/ddb/db_interface.c log diff annotate
src/sys/arch/sh/include/db_machdep.h log diff annotate
src/sys/arch/sh/sh/db_disasm.c log diff annotate
src/sys/arch/sh/sh/db_interface.c log diff annotate
src/sys/arch/sh/sh/db_trace.c log diff annotate
message Substitute boolean_t/TRUE/FALSE by int/1/0.

date 2019-11-07T16:08:07Z
author mpi
files src/sys/arch/sh/include/db_machdep.h log diff annotate
src/sys/arch/sh/sh/db_disasm.c log diff annotate
message db_addr_t -> vaddr_t

date 2019-11-07T16:08:08Z
author mpi
files src/sys/arch/powerpc/ddb/db_disasm.c log diff annotate
src/sys/arch/powerpc/ddb/db_trace.c log diff annotate
src/sys/arch/sh/sh/db_interface.c log diff annotate
src/sys/arch/sh/sh/db_trace.c log diff annotate
message db_addr_t -> vaddr_t

date 2019-11-07T17:45:22Z
author krw
files src/sys/scsi/sd.c log diff annotate
message sd_size() is a wrapper around sd_read_cap_10() and sd_read_cap_16() so
rename it sd_read_cap().

Reduces possible confusion with the unrelated sdsize().

date 2019-11-07T20:42:28Z
author guenther
files src/sys/arch/alpha/conf/Makefile.alpha log diff annotate
src/sys/arch/amd64/conf/Makefile.amd64 log diff annotate
src/sys/arch/arm64/conf/Makefile.arm64 log diff annotate
src/sys/arch/armv7/conf/Makefile.armv7 log diff annotate
src/sys/arch/hppa/conf/Makefile.hppa log diff annotate
src/sys/arch/i386/conf/Makefile.i386 log diff annotate
src/sys/arch/landisk/conf/Makefile.landisk log diff annotate
src/sys/arch/loongson/conf/Makefile.loongson log diff annotate
src/sys/arch/luna88k/conf/Makefile.luna88k log diff annotate
src/sys/arch/macppc/conf/Makefile.macppc log diff annotate
src/sys/arch/octeon/conf/Makefile.octeon log diff annotate
src/sys/arch/sgi/conf/Makefile.sgi log diff annotate
src/sys/arch/sparc64/conf/Makefile.sparc64 log diff annotate
message The compiler -pg option implies -fno-ret-protector, as we want to disable
retguard and similar when profiling. However, that missed all the .S files,
as ${PROF} wasn't added when ${NORMAL_S} was converted from direct invocation
of ${AS} to instead use ${CC}. Similarly, mcount.o still had retguards
as it cannot be built with -pg. So: pass ${PROF} when compiling .S files,
and compile "no profiling" files with -fno-ret-protector on archs with
retguard.

feedback and ok mpi@ mortimer@

date 2019-11-07T21:54:49Z
author patrick
files src/sys/arch/arm/arm/cpufunc_asm.S log diff annotate
src/sys/arch/arm/arm/db_trace.c log diff annotate
src/sys/arch/arm/include/cpufunc.h log diff annotate
message Remove get_pc_str_offset(), which has been unused since we switched
to clang, where the stack frame format changed significantly.

Prompted by guenther@ noticing deprecated ASM warnings
ok drahn@