summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2017-06-08Remove esym (.data) patching. Thanks to Mark we stopped requiring thisPatrick Wildt
and with the random-order kernel we shouldn't be doing that anyway. ok kettenis@
2017-06-08ASLR, W^X, and guard pages trigger processor traps that result inAlexander Bluhm
SIGILL, SIGBUS, SIGSEGV signals. Make such memory violations visible in lastcomm(1). This also works if a programm tries to hide them with a signal handler. Manual kill -SEGV does not generate false positives. OK deraadt@
2017-06-08Notify userland when a new ND is reachable.Martin Pieuchot
The same notification is already present in ARP. From Jan Klemkow, ok bluhm@
2017-06-08Wrap startup code with .ent and .end for proper disassembly.Visa Hankala
2017-06-08Move loongson/octeon/sgi unmap_startup() under arch/mips64.Visa Hankala
2017-06-08Split early startup code out of locore.S into locore0.S. Adjust linkVisa Hankala
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, smash the startup code with traps so that it does not point to the other randomly placed code. It has be smashed, because sgi runs in the kseg0 or xkphys space. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-06-08Split early startup code out of locore.S into locore0.S. Adjust linkVisa Hankala
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, smash the startup code with traps so that it does not point to the other randomly placed code. It has be smashed, because loongson runs in the kseg0 space. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-06-08Split early startup code out of locore.S into locore0.S. Adjust linkTheo de Raadt
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. I haven't worked on the unmap/smashing of the startup code yet.
2017-06-08remove the _rb_color prototype in RBT, it's unused/unimplimentedDavid Gwynne
2017-06-08make rb_n2e return a struct rb_entry *, not void *David Gwynne
maybe this will help prevent misassignment in the future.
2017-06-08use unsigned long instead of caddr_t to move between nodes and entries.David Gwynne
this removes the need for sys/param.h. this code can be built with only sys/tree.h, which in turn only needs sys/_null.h.
2017-06-08add RBT_SET_LEFT, RBT_SET_RIGHT, and RBT_SET_PARENTDavid Gwynne
this are provided so an RBT and it's topology can be copied without having to reinsert the copied nodes into a new tree. there are two reasons RBT_LEFT/RIGHT/PARENT macros cant be used like RB_LEFT/RIGHT/PARENT for this. firstly, RBT_LEFT and co are functions that return a pointer value, they dont provide access to the pointer itself for use as an lvalue that you can assign to. secondly, RBT entries dont store pointers to other nodes, they point to the RBT_ENTRY structures inside other nodes. this means that RBT_SET_LEFT and co have to get an offset from the node to the RBT_ENTRY and store that.
2017-06-08make the gem tx path MPSAFE.David Gwynne
this mostly follows the pattern in ifq.h ok jmatthew@
2017-06-07Add an acct(5) flag for pledge violations. Then lastcomm(1) showsAlexander Bluhm
when something went wrong. This allows to monitor whether the system is under attack and that the attack has been prevented by OpenBSD pledge(2). OK deraadt@ millert@ jmc@
2017-06-07Acquire submit queue mutex only once per xbf_complete_cmd invocationMike Belopuhov
and remove some leftover assertions.
2017-06-07Assert that the KERNEL_LOCK() is held when messing with routing,Martin Pieuchot
pfkey and unix sockets. ok claudio@
2017-06-07Assert that the calling CPU is holding the KERNEL_LOCK() in malloc(9)Martin Pieuchot
and free(9). The exception is at early boot when only one CPU is running since we grab the KERNL_LOCK() relatively late in main(). ok kettenis@
2017-06-07Grab the KERNEL_LOCK() around rtm*() functions. Routing sockets globalsMartin Pieuchot
aren't protected by the NET_LOCK(). While here change lock assertions in rt_{set,put}gwroute(), the NET_LOCK() is enough. Tested by Hrvoje Popovski. ok jmatthew@, claudio@
2017-06-06Set the weak variant of hysteresis as default.Ulf Brosziewski
2017-06-06Rewrite the driver to handle 64kb transfersMike Belopuhov
Although several codepaths in the kernel such as coredump and buffercache read-ahead feature assume that underlying hardware is capable of handling 64kb transfers without any issues, xbf was setup to rely on a single descriptor per transfer which limited the maximum size of an individual transfer to 11 4k segments amounting to 44k bytes. To avoid overbooking, a metadata object is allocated for each transfer to keep track of associated descriptors limiting the maximum amount of outstanding transfers to half the ring size. The issue was reported by Dan Cross <crossd at gmail.com>, thanks!
2017-06-06Call xbf_intr for polled transfers that can't sleepMike Belopuhov
2017-06-06Add support for tap gestures.Ulf Brosziewski
2017-06-06Provide sufficient info in error messages to identifyKenneth R Westerback
softraid volume and backing disk when i/o errors occur. Original issue reported by Paul de Weerd. Suggestions from jsing@. ok deraadt@ mikeb@
2017-06-06Remove code that is not needed right now.Visa Hankala
2017-06-06Implement startup smashing in C. The code should be movedVisa Hankala
under arch/mips64 once loongson and sgi have gap.o. Discussed with deraadt@
2017-06-06Update panic strings, pipex no longer use rn_inithead0().Martin Pieuchot
2017-06-06Do not rely on <net/rtable.h> beeing included by other headers.Martin Pieuchot
Fix build without PF, PIPEX nor IPSEC.
2017-06-06Fix build without PF.Martin Pieuchot
2017-06-06correct the depend list of a target introduced in rev 1.9Jonathan Gray
from deraadt@
2017-06-06Regen.Kevin Lo
2017-06-06Sort DLINK section and add USB device ID of D-Link DWA-131 rev E1.Kevin Lo
ok stsp@
2017-06-05- let's add PF_LOCK()Alexandr Nedvedicky
to enable PF_LOCK(), you must add 'option WITH_PF_LOCK' to your kernel configuration. The code does not do much currently it's just the very small step towards MP. O.K. henning@, mikeb@, mpi@
2017-06-05Split early startup code out of locore.S into locore0.S. Adjust linkTheo de Raadt
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. The bootstrap code will need smashing because it is mapped by BLTB, but this is a bit involved so not done yet. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. The only known offsets are in the startup code (which will be gone when it is smashed). Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-06-05Increase kernel size, by pushing rodata 1MB forward, from 5MB to 6MB.Theo de Raadt
This seems to satisfy the BTLB granularity. Good enough for now. ok kettenis
2017-06-05Split early startup code out of locore.S into locore0.S. Adjust linkTheo de Raadt
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, smash the startup code with traps so that it does not point to the other randomly placed code. It has be smashed, because alpha (insecurely in my view) runs in the KSEG0 space. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. The only known offsets are in the startup code, which is gone. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression.
2017-06-05include machine/param.h before machine.asm.h because uhm alpha.Theo de Raadt
2017-06-05track permissions of original fileTheo de Raadt
2017-06-05use same idiom as other MakefilesTheo de Raadt
2017-06-05Randomize the link order of .o files in the kernel on octeon.Visa Hankala
Unlike on some other architectures, it is not possible to unmap the early boot code. Instead, the code is smashed during boot. Input from deraadt@
2017-06-05Avoid use of _C_LABEL, since it is not portable to all our architectures.Theo de Raadt
And anyways, everything is ELF now.
2017-06-05The arm* architectures edit the ld.script, creating a copy in the compileTheo de Raadt
directories. Copy it in the same way on other architectures, for the same effect. Something upcoming will want that file there anyways.
2017-06-05use byte swapping loads and stores.David Gwynne
shrinks the code a bit on sparc64. ok jmatthew@
2017-06-04Catch up with changes made on amd64 (kettenis@):Christian Weisgerber
Generating mixed 16-bit/32-bit/64-bit code with clang's integrated assembler is a bit tricky. It supports the .code16, .code32 and .code64 directives. But it doesn't know about the data16/data32 and addr16/addr32 instruction prefixes. Instead it tries to determine those from the instruction opcode. It mostly succeeds, but there are a couple of corner cases where clang will generate the "addr32" form where gas generates the "addr16" form in .code16 segments. That should be no problem (and just waste a couple of bytes), but it makes comparing the generated code a bit difficult. Allow the trampoline code to be compiled with both. For clang #define away the addr32 prefix and avoid using the data32 prefix by using a mnemonic that explicitly encodes the size of the operand. Add a few addr32 prefixes in .code16 blocks to reduce the differences between code generated by clang and gas. ok deraadt@
2017-06-04fix a bungled logical/bitwise expression pointed out by clang; ok deraadt@Christian Weisgerber
2017-06-04Remove unused function, as pointed out by clang. ok deraadt@ kettenis@Christian Weisgerber
2017-06-04Create gap.* with umask 007 instead of 077 to make kernel builds afterTheo Buehler
make release work without prior cleanup. discussed with deraadt
2017-06-04Switch the radeondrm(4) driver over to TTM using the new DRM VMA manager.Mark Kettenis
ok jsg@
2017-06-04Remove comment that no longer is true. esym is not written by ourPatrick Wildt
bootloader anymore, so it doesn't matter where it is stored. While there do some whitespace cleanup.
2017-06-04Split early startup code out of locore.S into locore0.S. Adjust linkPatrick Wildt
run so that this locore0.o is always at the start of the executable. But randomize the link order of all other .o files in the kernel, so that their exec/rodata/data/bss segments land all over the place. Late during kernel boot, unmap the early startup code. As a result, the internal layout of every newly build bsd kernel is different from past kernels. Internal relative offsets are not known to an outside attacker. The only known offsets are in the startup code, which has been unmapped. Ramdisk kernels cannot be compiled like this, because they are gzip'd. When the internal pointer references change, the compression dictionary bloats and results in poorer compression. With guidance and ok deraadt@
2017-06-04Switch the TTM code over to the generic DRM VMA manager.Mark Kettenis
ok jsg@