rethinking openbsd security
panic: bad dir
There’s a few possible causes for this, but inspection revealed that the most likely case might be a directory entry missing the nul terminator. The timing certainly seemed suspicious. Could there be an off by one?
memset(newdirp->d_name + (cnp->cn_namelen & ~(DIR_ROUNDUP-1)), 0, DIR_ROUNDUP);
Actually no. syzkaller had found a way to create filesystem corruption through one of the “expected” damage paths, but the test case was a little obfuscated. More study revealed it was calling mknod to create a new device that happened to be equal to
/dev/sd0c and opening it, and then calling pwrite to write some garbage to a random spot.
mknod("banana", 0777, 0x0402); open("banana") pwrite(3, "oops", 4, 0x9000);
Further complicating the matter was that syzkaller didn’t know that pwrite is one of the magic syscalls that takes a padding argument before off_t. This didn’t affect the test, per se, but makes it harder to interpret because syzkaller calls things directly. (The actual syscall in use was the iovec variant, pwritev.)
syscall(SYS_pwritev, r, 0x200002c0, 1, 0);
If you read the man page for pwritev that looks correct. But inspecting
src/sys/kern/syscalls.master reveals that the fourth argument is actually a pad argument, and the offset is the fifth argument. So the call above was writing to an offset that was not zero.
Not the first fuzzer to encounter this oddity. More details here.
In the end, it was just coincidence that syzkaller found a new way to corrupt its filesystem a few days after a filesystem commit.
Note that octeon supports a few more machines.
Add support for isochronous transfers to xhci. Remains disabled.
Some of the i386 assembly implementations of math functions in compiler-rt use SSE2. Switch to using generic C code.
Use getrusage to measure CPU time in md5 benchmarking.
Add guard pages at the end of kernel stacks so overflows don’t run into important stuff.
Close the default syslogd 514 port.
Add dwxe driver for ethernet found on Allwinner A64, H3 and H5 SoCs.
Fix buffer overflow in perl regexp. Errata.
Fix a regression caused by removal of SIGIO from some devices.
In relayd, use EVBUFFER_EOL_CRLF so that “\r” by itself at the end of a chunk won’t be treated as end of line, causing the following “\n” to be interpreted as a blank line.
In malloc, always delay freeing chunks and change ‘F’ option to perform a more extensive check for double free.
EuroBSDcon happened. There are talks and slides.
Change sendsyslog prototype to take a string, since there’s little point logging not strings.
Validate the TCB (thread control block) pointer which lives in the GS register. Errata.
Removing DDB_STRUCTINFO broke the kernel makefiles by removing too many dependencies, leading to some bad kernels. Put back the good stuff.
Add a kill command to ddb.
Update to unbound 1.6.6.
Add preliminary kabylake support to inteldrm(4) by backporting the relevant commits from linux-4.8.x.
OpenSSH is now version 7.6.
62.html is under construction.
The config program tries to modify zero initialized variables. Previous versions of gcc were patched to place these in the data segment, instead of the bss, but clang has no such patches. Long long ago, this was the default behavior for compilers, which is why gcc was patched to maintain that existing behavior, but now we want a slightly less unusual toolchain. Fix the underlying issue for now by annotating such variables with a data section attribute.
The xrstor instruction will fault if it’s unhappy. Handle this properly. Errata.
6.2-current, back to work.