OpenBSD cvs log

created 2019-02-12T07:07:14Z
begin 2019-01-31T00:00:00Z
end 2019-02-07T00:00:00Z
path src/sys
commits 32

date 2019-01-31T02:00:27Z
author dlg
files src/sys/net/if_mpe.c log diff annotate
message use "sc" as the name of the softc variable in the ioctl code too.

while there, assign int when declaring the sc variable so the ioctl
paths do less.

date 2019-01-31T05:00:18Z
author cheloha
files src/sys/kern/kern_tc.c log diff annotate
message tc_setclock: Don't rewind the system uptime during resume/unhibernate.

When we come back from suspend/hibernate the BIOS/firmware/whatever can
hand us *any* TOD, so we need to check that the given TOD doesn't set our
boot offset backwards, breaking the monotonicity of e.g. CLOCK_MONOTONIC.
This is trivial to do from the BIOS on most PCs before unhibernating.
There might be other ways it can happen, accidentally or otherwise.

This is a bit messy but it can be made prettier later with a "bintimecmp"
macro or something like that.

Problem confirmed by jmatthew@.

"you are very likely right" deraadt@

date 2019-01-31T05:33:51Z
author tedu
files src/sys/sys/sysctl.h log diff annotate
message remove remnant of jackport

date 2019-01-31T11:38:52Z
author stsp
files src/sys/dev/ic/athn.c log diff annotate
src/sys/dev/ic/athnvar.h log diff annotate
message Enable IQ/ADC calibration in the athn(4) driver.
Code for this was already present, it was just not being called yet.
Tested on AR9280 and AR9271 by jmc@, kevlo@, jmatthew@, juanfra@, and myself.

date 2019-01-31T14:35:06Z
author patrick
files src/sys/arch/arm64/arm64/machdep.c log diff annotate
src/sys/arch/arm64/stand/efiboot/Makefile log diff annotate
src/sys/arch/arm64/stand/efiboot/conf.c log diff annotate
src/sys/arch/arm64/stand/efiboot/disk.h log diff annotate
src/sys/arch/arm64/stand/efiboot/efiboot.c log diff annotate
src/sys/arch/arm64/stand/efiboot/efidev.c log diff annotate
src/sys/arch/arm64/stand/efiboot/efidev.h log diff annotate
src/sys/arch/arm64/stand/efiboot/softraid_arm64.c log diff annotate
src/sys/arch/arm64/stand/efiboot/softraid_arm64.h log diff annotate
message Implement booting from softraid on arm64. This consists of creating a
list of available block devices, so we can also boot from another block
device than the one that efiboot was loaded from. Softraid will then
create a list of volumes by checking the partition table for RAID and
matching softraid metadata. If efiboot was loaded from the same
physical drive as a softraid volume, it will use the soft- raid volume
as boot device and it will ask you to unlock it. The UUID and key of
that boot volume will be passed as FDT properties to the kernel. Those
FDT properties will be zeroed explicitly by the kernel after they have
been passed to the softraid stack.

ok kettenis@

date 2019-01-31T18:01:14Z
author millert
files src/sys/dev/ic/aic79xx.c log diff annotate
src/sys/dev/pci/ahd_pci.c log diff annotate
src/sys/dev/pci/drm/i915/i915_vgpu.c log diff annotate
src/sys/dev/usb/uhci.c log diff annotate
src/sys/dev/wscons/wskbdutil.c log diff annotate
src/sys/net/pipex.c log diff annotate
src/sys/net/pipex_local.h log diff annotate
message Fix compilation of amd64 kernel when optimization is disabled.
C99 inline semantics resulted in undefined symbols.
OK deraadt@ mpi@ dlg@

date 2019-01-31T18:23:27Z
author tedu
files src/sys/kern/kern_time.c log diff annotate
message matthew noticed that some clocks use tfind() which is not mpsafe.
add locking in clock_gettime where needed.
ok cheloha matthew

date 2019-01-31T23:17:26Z
author kettenis
files src/sys/arch/arm64/stand/efiboot/conf.c log diff annotate
message Bump version number to be able to distinguish bootloaders with softraid
support.

date 2019-02-01T00:51:07Z
author patrick
files src/sys/dev/fdt/if_fec.c log diff annotate
message Fix lost interrupts in fec(4). Apparently the tick that talks to the
phy to check the media status did not only ack the MII interrupt, but
also all the others. Thus it could happen that the TX completion was
not seen by the interrupt handler, leading to full TX queues. Also,
the fec(4) interrupt handler acked more than it handles, thus possibly
also acking the MII interrupt.

Found with bluhm@ on his new arm64 regression setup.

ok bluhm@

date 2019-02-01T06:11:16Z
author jmatthew
files src/sys/dev/pci/if_ixl.c log diff annotate
message fix up calculation of our physical function id, making the second port
on dual port cards work much better.

ok dlg@

date 2019-02-01T07:02:31Z
author anton
files src/sys/dev/wscons/wskbd.c log diff annotate
message In wskbdclose(), use the same logic as in wskbdopen() to determine if
the device was opened in write-only mode. Relying on me_evar being NULL
does not work if the wskbd device was opened first followed by opening a
wsmux device. Closing the wskbd device first at this stage would cause
the wscons_event queue inherited from the wsmux device to be freed. This
in turn could cause a panic if an ioctl(WSMUXIO_INJECTEVENT) command is
issued to the wsmux device.

ok deraadt@ visa@

Reported-by: syzbot+ed88256423ae8d882b8b@syzkaller.appspotmail.com

date 2019-02-01T10:43:43Z
author dlg
files src/sys/kern/uipc_mbuf.c log diff annotate
message make m_pullup use the first mbuf with data to measure alignment.

this fixes an issue found by a regress test on sparc64 by claudio,
and between us took about half a day of work to understand and fix
at a2k19.

ok claudio@

date 2019-02-01T13:24:15Z
author mpi
files src/sys/dev/usb/xhci.c log diff annotate
message Print xhci version in hex, from sc.dying at gmail.

date 2019-02-01T13:29:48Z
author mpi
files src/sys/net/pfkeyv2.c log diff annotate
message Do not silently return if extensions do not match the filters.

ok bluhm@, visa@

date 2019-02-01T13:32:00Z
author mpi
files src/sys/net/pfkeyv2.c log diff annotate
src/sys/net/pfkeyv2_parsemessage.c log diff annotate
message Export per-TDB counters to userland.

This time add the counter extention to SADB_GET's whitelist.

ok bluhm@, visa@

date 2019-02-01T16:15:07Z
author stsp
files src/sys/dev/ic/ar5008.c log diff annotate
src/sys/dev/ic/ar5416.c log diff annotate
src/sys/dev/ic/ar5416reg.h log diff annotate
src/sys/dev/ic/ar9003.c log diff annotate
src/sys/dev/ic/ar9280.c log diff annotate
src/sys/dev/ic/ar9280reg.h log diff annotate
src/sys/dev/ic/ar9285.c log diff annotate
src/sys/dev/ic/ar9285reg.h log diff annotate
src/sys/dev/ic/ar9287.c log diff annotate
src/sys/dev/ic/ar9287reg.h log diff annotate
src/sys/dev/ic/athn.c log diff annotate
src/sys/dev/ic/athnreg.h log diff annotate
src/sys/dev/ic/athnvar.h log diff annotate
message Complete athn(4) noisefloor calibration code and enable it.
Update default/min/max noisefloor values to those used by Linux ath9k.
Tested by jmc, juanfra, kn, and myself, on 9280 and 9271 devices.

date 2019-02-01T17:23:08Z
author anton
files src/sys/dev/wscons/wsevent.c log diff annotate
message free size for wscons_event; ok deraadt@ visa@

date 2019-02-01T21:48:48Z
author mlarkin
files src/sys/arch/amd64/amd64/pmap.c log diff annotate
message Properly account wired pages in pmap_randomize_level

This change fixes a regress test failure noticed by bluhm@.

ok deraadt

date 2019-02-02T14:32:58Z
author visa
files src/sys/arch/amd64/amd64/db_trace.c log diff annotate
message Improve stack trace saving on amd64:

* Replace unnecessary use of db_get_value() with direct access of
f_retaddr. The trace function assumes that the chain of frames
is good in terms of alignment and content.

* Replace the for loop with a while loop and drop the check
"frame != NULL" from the loop condition. The check is redundant with
the "!INKERNEL(frame)" condition. The code already assumes that the
initial frame is valid.

* Stop iteration if f_retaddr is a non-kernel address in order to
not save a user address at the end of the trace. This additionally
fixes a kernel crash that would happen if the user thread had
a broken frame pointer.

* Fix erroneous skipping of the second stack frame.

OK mpi@

date 2019-02-02T14:34:09Z
author visa
files src/sys/arch/i386/i386/db_trace.c log diff annotate
message Improve stack trace saving on i386:

* Replace unnecessary use of db_get_value() with direct access of
f_retaddr. The trace function assumes that the chain of frames
is good in terms of alignment and content.

* Replace the for loop with a while loop and drop the check
"frame != NULL" from the loop condition. The check is redundant with
the "!INKERNEL(frame)" condition. The code already assumes that the
initial frame is valid.

* Stop iteration if f_retaddr is a non-kernel address in order to
not save a user address at the end of the trace. This additionally
fixes a kernel crash that would happen if the user thread had
a broken frame pointer.

OK mpi@

date 2019-02-03T01:45:57Z
author guenther
files src/sys/arch/amd64/amd64/trap.c log diff annotate
message Delete cases in kerntrap() that just jump to the default case

ok mlarkin@

date 2019-02-03T05:33:48Z
author visa
files src/sys/uvm/uvm_fault.c log diff annotate
message Always refault if relocking maps fails after IO. This fixes a regression
introduced with __MAP_NOFAULT. The regression let uvm_fault() run
without proper locking and rechecking of state after map version change
if page zero-fill was chosen.

OK kettenis@ deraadt@

Reported-by: syzbot+9972088c1026668c6c5c@syzkaller.appspotmail.com

date 2019-02-03T10:58:51Z
author dlg
files src/sys/arch/amd64/conf/Makefile.amd64 log diff annotate
message enable -msave-args when building with clang.

this allows us to provide actual arguments in functions in ddb traces.

deraadt@ helped me figure out that a new clang has been in snaps
for days now, so it's easy for people to get a new compiler if
they're building current.

date 2019-02-03T14:03:36Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/mvgicp.c log diff annotate
src/sys/dev/fdt/mvicu.c log diff annotate
message Add mvgicp(4), a driver for the Marvell extension to the GIC that
allows triggering SPI interrupts by doing memory transactions. This was
already partially implemented in mvicu(4) and is now outsourced into its
own driver since we need better initialization when booting using u-boot.
Also implement new and legacy bindings in mvicu(4), relying on the new
mvgicp(4) driver.

ok kettenis@

date 2019-02-03T23:04:49Z
author dlg
files src/sys/net/if_tun.c log diff annotate
message let tun read AF_MPLS packets from userland.

date 2019-02-04T07:04:28Z
author anton
files src/sys/kern/sysv_sem.c log diff annotate
message When freeing the sem_undo structure in semundo_adjust(), update the
caller supplied pointer. Otherwise, the caller is left with a dangling
pointer that could lead to a use-after-free panic.

ok millert@ visa@

Reported-by: syzbot+ac1d7685deab53b95ace@syzkaller.appspotmail.com
Reported-by: syzbot+dbe8f002f8051f26f6fe@syzkaller.appspotmail.com

date 2019-02-04T10:33:56Z
author kettenis
files src/sys/dev/sdmmc/if_bwfm_sdio.c log diff annotate
message Turns out we do need to handle control messages that exceed MLEN, so
allocate a cluster if the message is larger than that. Fixes a panic
on shutdown on my Asus X205TA.

ok patrick@, stsp@

date 2019-02-04T13:28:55Z
author visa
files src/sys/kern/subr_witness.c log diff annotate
message Make callers of witness_lock_list_{get,free}() responsible of raising
the system priority level to IPL_HIGH. This simplifies the code a bit
relative to calling from witness_lock() and witness_unlock().

OK mpi@

date 2019-02-04T21:40:52Z
author bluhm
files src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/net/pfkeyv2.c log diff annotate
src/sys/net/rtsock.c log diff annotate
src/sys/netinet/ip_divert.c log diff annotate
src/sys/netinet/raw_ip.c log diff annotate
src/sys/netinet/udp_usrreq.c log diff annotate
src/sys/netinet6/ip6_divert.c log diff annotate
src/sys/netinet6/raw_ip6.c log diff annotate
message Avoid an mbuf double free in the oob soreceive() path. In the
usrreq functions move the mbuf m_freem() logic to the release block
instead of distributing it over the switch statement. Then the
goto release in the initial check, whether the pcb still exists,
will not free the mbuf for the PRU_RCVD, PRU_RVCOOB, PRU_SENSE
command.
OK claudio@ mpi@ visa@
Reported-by: syzbot+8e7997d4036ae523c79c@syzkaller.appspotmail.com

date 2019-02-06T15:11:20Z
author mpi
files src/sys/kern/sys_futex.c log diff annotate
message Use ktrreltimespec() as the timeout is relative, pointed by matthew@.

ok cheloha@

date 2019-02-06T17:32:16Z
author bluhm
files src/sys/netinet/tcp_usrreq.c log diff annotate
message Fix a possible mbuf leak in tcp_usrreq(). Make the error handling
more consistent to the other protocols' usrreq functions.
OK visa@ claudio@

date 2019-02-06T22:59:06Z
author patrick
files src/sys/dev/fdt/if_fec.c log diff annotate
message Rework fec(4). I have written this driver in 2012 as my first ever
ethernet controller driver. Handling of descriptors and buffers has
not been great. There was no way to recover from a full tx queue.
This introduces a mechanism akin to dwxe(4) and tsec(4) and fixes
that. On rd we now map mbufs directly. On tx we can do that as
well for newer SoCs. The i.MX6 Q/DL generation still needs a bounce
buffer on tx for proper alignment.

Tested with bluhm on Cubox-i (armv7) and Hummingboard Pulse (arm64)