OpenBSD cvs log

created 2019-02-07T02:49:29Z
begin 2018-12-06T00:00:00Z
end 2018-12-13T00:00:00Z
path src/sys
commits 29

date 2018-12-06T07:50:38Z
author stsp
files src/sys/dev/usb/if_athn_usb.c log diff annotate
message Avoid unnecessary dynamic memory allocation in athn_usb_newauth().
Patch by Benjamin Baier
ok ratchov@ mpi@

date 2018-12-06T08:11:52Z
author claudio
files src/sys/netinet6/nd6_nbr.c log diff annotate
message When building ND packets use m_align() to pack the mbuf as optimal as
possible. Because of an optional payload maxlen bytes are used on the
m_align so that there is always enough space.
OK florian@

date 2018-12-06T18:59:31Z
author guenther
files src/sys/kern/exec_elf.c log diff annotate
src/sys/sys/exec_elf.h log diff annotate
message Core files with >65535 sections have to use PN_XNUM and a section header
to pass the real count, with a minimal .shstrtab segment for consistency.
Also, add support for PN_XNUM to readelf.

problem reported and testing by claudio@
ok kettenis@

date 2018-12-07T01:53:20Z
author kevlo
files src/sys/dev/ic/r92creg.h log diff annotate
src/sys/dev/ic/rtwn.c log diff annotate
src/sys/dev/usb/if_urtwn.c log diff annotate
message Handle 2 Tx chains in the computation of transmit power for the RTL8192EU.
While here sort vendors.

Tested by jmatthew@

ok stsp@, jmatthew@

date 2018-12-07T08:37:24Z
author claudio
files src/sys/sys/mbuf.h log diff annotate
message All the references to the M_ALIGN and MH_ALIGN macros are gone.
Time to bring them behind the shed and free them. Use m_align() instead.
OK mpi@ henning@ florian@ kn@

date 2018-12-07T10:01:06Z
author florian
files src/sys/netinet6/nd6_nbr.c log diff annotate
message We are not going to send a neighbor advertisement from a non-master
carp interface. Move the check to the beginning of the function to
make it clear that there are no other side effects happening.
OK claudio

date 2018-12-07T16:17:51Z
author mpi
files src/sys/net/bridgestp.c log diff annotate
message Remove useless spl protection.

ok visa@

date 2018-12-07T16:19:40Z
author mpi
files src/sys/net/if_bridge.c log diff annotate
src/sys/net/if_bridge.h log diff annotate
src/sys/net/if_switch.c log diff annotate
message Stop passing `sc' when it isn't needed and use `ifp' where it's good

ok sthen@, visa@

date 2018-12-07T16:21:19Z
author mpi
files src/sys/kern/vfs_subr.c log diff annotate
src/sys/sys/mount.h log diff annotate
message free(9) sizes for netcred.

ok visa@

date 2018-12-07T21:33:28Z
author patrick
files src/sys/arch/arm/cortex/ampintc.c log diff annotate
src/sys/arch/arm64/dev/agintc.c log diff annotate
src/sys/arch/arm64/dev/ampintc.c log diff annotate
src/sys/arch/armv7/marvell/mvmpic.c log diff annotate
message For shared interrupts we need to make sure that we register
with the lowest IPL. Once we actually run the IRQ handler
we raise to the highest IPL. Fixes a crash seen when having
a network card in the PCIe slot of the MacchiatoBin.

ok ccardenas@

date 2018-12-09T19:38:40Z
author kn
files src/sys/net/pfvar.h log diff annotate
message Zap duplicate signatures

Redundant under _KERNEL since introduction in r1.260 from 2006.

OK jca

date 2018-12-10T05:40:34Z
author visa
files src/sys/arch/sgi/dev/if_mec.c log diff annotate
message Fix phy discovery on O2 systems.

After a cold boot, the mii bus appears to take some time to initialize;
the phy does not answer to address 8 but to a larger address (10 or 11),
then, after being reset, to its correct address of 8.

So the kernel would discover the phy at a wrong address, attach it, and
after it gets reset, reading from the phy at the wrong address would
return either all bits clear or all bits set, confusing the link speed
logic without any way to recover.

Work around the issue by resetting all phys found when the interface is
reset for the first time. Thus, by the time mii_attach() runs and walks
the bus again, the phy will answer at the right address.

From miod@

date 2018-12-10T05:42:34Z
author visa
files src/sys/arch/sgi/dev/if_mec.c log diff annotate
src/sys/arch/sgi/dev/if_mecreg.h log diff annotate
message Clean up the mec(4) MII read/write routines a bit.

The PHY register offsets are adjusted because the registers are accessed
using 64-bit loads and stores.

From miod@

date 2018-12-10T13:35:54Z
author landry
files src/sys/sys/sensors.h log diff annotate
message Add a velocity sensor type (displayed as m/s)

Change distance sensor type to be displayed as meters with 3 decimals
instead of millimeters.

ok mpi@ kettenis@

date 2018-12-10T16:48:05Z
author jsing
files src/sys/arch/amd64/stand/libsa/exec_i386.c log diff annotate
src/sys/arch/i386/stand/libsa/exec_i386.c log diff annotate
message Do not call free on a non-allocated pointer.

ok deraadt@

date 2018-12-10T16:48:15Z
author kn
files src/sys/net/if_pflog.c log diff annotate
src/sys/net/pf.c log diff annotate
src/sys/net/pf_if.c log diff annotate
src/sys/net/pf_ioctl.c log diff annotate
src/sys/net/pf_lb.c log diff annotate
src/sys/net/pf_table.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message Remove useless macros

These are just unhelpful case conversion.

OK sashan henning

date 2018-12-10T16:52:02Z
author jsing
files src/sys/arch/amd64/stand/libsa/exec_i386.c log diff annotate
src/sys/arch/i386/stand/libsa/exec_i386.c log diff annotate
message Ensure that we close the file descriptor after loading microcode.

Otherwise we end up keeping file descriptor and inode related buffers
around, that are unnecessarily consuming memory.

ok deraadt@ patrick@

date 2018-12-10T21:13:59Z
author claudio
files src/sys/arch/amd64/amd64/vmm.c log diff annotate
message Start passing the IO ports 0x510, 0x511, 0x514, and 0x518 to vmd(8).
These IO ports are used by qemu's fw_cfg interface and vmd(8) will start
using it to pass options to SeaBIOS.
OK mlarkin@

date 2018-12-10T23:00:01Z
author bluhm
files src/sys/netinet6/icmp6.c log diff annotate
message When forwarding IPv6 packets, generated ICMP6 packets used the
interface address of the route as source address. To avoid using
link-local addresses in ICMP6 packets sent into networks where they
are out of scope, use the regular IPv6 source selection algorithm
also in this icmp6_reflect() case.
reported by sthen@; fix from Arnaud BRAND; OK claudio@

date 2018-12-11T01:27:08Z
author dlg
files src/sys/net/if_ethersubr.c log diff annotate
src/sys/netinet/if_ether.h log diff annotate
message split ether_output into resolution, encapsulation, and output functions

if if_output can be overridden on ethernet interfaces, it will allow
things like vlan to do it's packet encapsulation during output
before putting the packet directly on the underlying interface for

this has two benefits. first, it can avoid having ether_output on
pseudo interfaces recurse, which makes profiling of the network
stack a lot clearer. secondly, and more importantly, it allows
pseudo ethernet interface packet encapsulation to by run concurrently
by the stack, rather than having packets unnecessarily serialied
by an ifq.

this diff just splits ether_output up, it doesnt have any interface
take advantage of it yet.

tweaks and ok claudio@

date 2018-12-11T01:33:05Z
author dlg
files src/sys/net/ifq.c log diff annotate
src/sys/net/ifq.h log diff annotate
message add ifq_hdatalen for getting the size of the packet at the head of an ifq

this gets the locks right, and returns 0 if there's no packet available.

ok stsp@

date 2018-12-11T01:34:10Z
author dlg
files src/sys/net/if_tun.c log diff annotate
message use ifq_hdatalen for handling the FIONREAD ioctl

ok stsp@

date 2018-12-11T01:36:42Z
author dlg
files src/sys/net/ifq.c log diff annotate
src/sys/net/ifq.h log diff annotate
message provide ifq_is_priq, mostly so things can tell if hfsc is in effect or not.

date 2018-12-11T22:08:57Z
author dlg
files src/sys/net/if.c log diff annotate
src/sys/net/if_var.h log diff annotate
message add optional per-cpu counters for interface stats.

these exist so interfaces that want to do mpsafe work outside the
ifq machinery have a place to allocate and update stats in. the
generic ioctl handling for getting stats to userland knows how to
roll the new per cpu stats into the rest before export.

ok visa@

date 2018-12-12T05:38:26Z
author dlg
files src/sys/net/if_ethersubr.c log diff annotate
message allow ethernet interfaces to provide a custom if_output routine.

this will be mostly useful for virtual interfaces like vlan and
etherip, where they can bypass queueing on an ifq, and instead
encapsulate in on multiple cpus concurrently and push the packet
onto the next layer directly.

ok visa@

date 2018-12-12T07:29:38Z
author anton
files src/sys/dev/kcov.c log diff annotate
message Make kcov MP-safe. Calling the injected tracing function
__sanitizer_cov_trace_pc() early in the boot process caused a subtle
crash while booting the secondary CPU(s). On amd64, accessing curcpu
during this period is not safe since its GSBASE register is yet not
written. After the CPU has been booted curproc can also be NULL for a
brief period of time before the idle thread tied to the same CPU has
started. The two problems can simply be avoided by postponing access to
curcpu and curproc until /dev/kcov has been opened at least once.

The end goal here is to allow fuzzing of MP kernels, which already is in
full swing.

This work has gone through many iterations before settling on the least
intrusive change; many thanks for visa@ for reviewing and providing
valuable input.

Issue originally reported by Greg Steuck on tech@ who also took the time
to test all iterations and providing me access to a virtualised OpenBSD
machine for easier testing.

ok mpi@ visa@

date 2018-12-12T14:15:00Z
author mpi
files src/sys/kern/sysv_sem.c log diff annotate
message free(9) sizes for SVID semaphores.

ok bluhm@, visa@

date 2018-12-12T14:15:35Z
author mpi
files src/sys/kern/sysv_shm.c log diff annotate
message free(9) sizes for sysv shm.

ok bluhm@, visa@

date 2018-12-12T14:19:15Z
author mpi
files src/sys/net/bridgectl.c log diff annotate
src/sys/net/if_bridge.c log diff annotate
message Various cleanups:

- Unify the two hooks by passing the same argument
- Check for nullity before dereferencing `if_bridgeport', this will
matter when we go MP
- Use the same pattern to find a member in the ioctl path

ok bluhm@, visa@