summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
AgeCommit message (Collapse)Author
2020-05-31introduce "cpu_rnd_messybits" for use instead of nanotime in dev/rnd.c.David Gwynne
rnd.c uses nanotime to get access to some bits that change quickly between events that it can mix into the entropy pool. it doesn't use nanotime to get a monotonically increasing set or ordered and accurate timestamps, it just wants something with bits that change. there's been discussions for years about letting rnd use a clock that's super fast to read, but not necessarily accurate, but it wasn't until recently that i figured out it wasn't interested in time at all, so things like keeping a fast clock coherent between cpu cores or correct according to ntp is unecessary. this means we can just let rnd read the cycle counters on cpus and things will be fine. cpus with cycle counters that vary in their speed and arent kept consistent between cores may even be desirable in this context. so this is the first step in converting rnd.c to reading cycle counter. it copies the nanotime backend to each arch, and they can replace it with something MD as a second step later on. djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits. thanks to visa for his eyes. ok deraadt@ visa@ deraadt@ says he will help handle any MD fallout that occurs.
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2020-05-27Retire <machine/varargs.h>.Visa Hankala
Nothing uses the header anymore. OK deraadt@ mpi@
2020-05-26/etc/random.seed reuse can now be detected. The stat +T bit marks the fileTheo de Raadt
(fchmod +T by bootcode, chmod 600 by /etc/rc). If the seed is reused, and HWRNG isn't available, the kernel won't get RB_GOODSEED indication...
2020-05-25make loadrandom() return 0 for success, -1 for failure. While here,Theo de Raadt
relax the fstat() check because the system will have left the file in the right mode. ok visa kettenis
2020-05-25Pass boothowto from bootblock to kernelTheo de Raadt
2020-05-25Add support for write operations to diskstrategy().Theo de Raadt
2020-05-23remove ifdef'd out tc fb cnattach bitsJonathan Gray
miod@ agrees this can go
2020-05-23remove more cfb and sfb bitsJonathan Gray
2020-05-23remove cfb and sfb alpha tc fb driversJonathan Gray
These were removed from files.alpha 1.105 in 2017 and the rcons bits they reference were removed in 2006. removal suggested by miod@
2020-05-17Put setjmp+longjmp inside #ifdef DDB the only kernel-side user.Theo de Raadt
This shrinks the ramdisks a tiny bit.
2020-05-16Make inittodr() and resettodr() MI.Mark Kettenis
ok deraadt@, mpi@, visa@ ok cheloha@ as well (would have preferred in new file for this code)
2020-05-11Use the same inittodr()/resettodr() implementation as onMark Kettenis
amd64/arm64/armv7/hppa/i386/landisk/macppc/mips64/sparc64 and move it to the end of machdep.c. Wrap the existing clockfns hooks into something that can be used as a todr_handle. ok deraadt@
2020-04-23 ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;Jason McIntyre
2020-03-11Allow alpha boot(8) to read from an ffs2 filesystem and adapt itsOtto Moerbeek
custom installboot to deal with ffs2. While there, fix the partition read code to deal with offsets > 2G; ok deraadt@
2020-03-05The 'lock spun out' db_printf needs a newline. All other MP_LOCKDEBUGClaudio Jeker
messages do have the newline already. OK anton@ kettenis@
2020-01-24Use major 32 for dt(4).Martin Pieuchot
ok visa@, kettenis@, deraadt@
2020-01-23wire up pppac(4) to some majors on each arch.David Gwynne
i was lazy and just put them at the end of the existing set. fyi, i think major 51 is free on all archs if anyone is looking for another one. ok claudio@
2019-12-17Add fido(4), a HID driver for FIDO/U2F security keysReyk Floeter
While FIDO/U2F keys were already supported by the generic uhid(4) driver, this driver adds the first step to tighten the security of FIDO/U2F access. Specifically, users don't need read/write access to all USB/HID devices anymore and the driver also improves integration with pledge(2) and unveil(2): It is pledge-friendly because it doesn't require any ioctls to discover the device and unveil-friendly because it uses a single /dev/fido/* directory for its device nodes. It also allows to support FIDO/U2F in firefox without further weakening the "sandbox" of the browser. Firefox does not have a proper privsep design and many operations, such as U2F access, are handled directly by the main process. This means that the browser's "fat" main process needs direct read/write access to all USB HID devices, at least on other operating systems. With fido(4) we can support security keys in Firefox under OpenBSD without such a compromise. With this change, libfido2 stops using the ioctl to query the device vendor/product and just assumes "OpenBSD" "fido(4)" instead. The ioctl is still supported but there was no benefit in obtaining the vendor product or name; it also allows to use libfido2 under pledge. With feedback from deraadt@ and many others OK kettenis@ djm@ and jmc@ for the manpage bits
2019-12-01Remove unused test program.Visa Hankala
OK deraadt@
2019-11-07The compiler -pg option implies -fno-ret-protector, as we want to disablePhilip Guenther
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@
2019-11-07Convert db_addr_t -> vaddr_t but leave the typedef for now.Martin Pieuchot
2019-11-07ANSIfy & substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok jasper@, deraadt@
2019-10-29Use arc4 to bit-spread the 512-byte random buffer over the .openbsd.randomdataTheo de Raadt
section, which has grown a fair bit with the introduction of retguard. Mortimer discovered the repeated 512-byte sequence as retguard keys, and this resolves the issue. (Chacha does not fit on the media, so 1.5K early drop RC4 is hopefully sufficient in our KARL link universe) Version crank the bootblocks. sysupgrade -s will install new bootblocks. ok djm mortimer
2019-09-06If uvm_map_inentry returns false then a signal has been delivered, andTheo de Raadt
userret() must be called on trap() exit to deliver it, rather than repeating the same cause infinitely. discovered by George Koehler ok kettenis bluhm visa
2019-09-04Remove DST/TIMEZONE options(4) from kernel configs; ok jca@ deraadt@cheloha
2019-08-03In the bootblocks, after discovering and opening /bsd.upgrade, fchmod -xTheo de Raadt
so the file cannot be re-executed upon the next boot. This provides a stronger one-shot-upgrade model than the upgrade script's rm /bsd.upgrade. Now various forms of upgrade failure will reboot into /bsd, which is probably more recoverable. Performing fchmod -x depends on (1) use of MI boot.c (not alpha/macppc/sparc64/sgi/octeon) and (2) "can write blocks" functionality in the IO layer. Most architectures have this support now. Two diagnostics "fchmod a-x %s: failed" and "/bsd.upgrade is not u+x" will remain in the tree while refinements happen for some of the laggard architectures. based upon a discussion florian tested in snapshots for more than a week without any complaints
2019-07-09I wrote the pc-page-writeable and sp-not-MAP_STACK code to be shared, andTheo de Raadt
then ran into the messaging being poor. Then I fixed the messages. But there are two sub-cases of sp-not-MAP_STACK -- one at syscall time, and another at regular userland trap (on some architectures), and I bungled that messaging. Correct that now, while I look for yet another better way... discovered by millert, who ran an pre-MAP_STACK binary.
2019-06-21Further improve the filesystem stability of kernel installation by KARL.Theo de Raadt
Use install -F to instead of cp, for fsync(2). Coupled with the new sync(8) in the reorder_kernel script, the window for a incomplete /bsd file on-disk due to a crash has now shrunk substantially. Discussion with kettenis, millert and tedu
2019-06-01Refactor the MAP_STACK feature, and introduce another similar variation:Theo de Raadt
Lookup the address that a syscall instruction is executed from, and kill the process if that page is writeable. This brings an aspect of W^X behaviour to W|X mappings (in JITs not yet adapted to W^X). The goal is to remove simple attack methods and force use of ret2libc or other more complicated means. ok kettenis stefan visa
2019-05-13free(9) sizes.Martin Pieuchot
From miod@
2019-05-08Enable ucrcom(4) on all architectures that have uslcom(4).Mark Kettenis
ok deraadt@
2019-04-14Instead of using COPTS=-Oz (and similar) in make environment to forceTheo de Raadt
tightly-built ramdisk kernels, set the option in per-arch Makefile.inc based upon SMALL_KERNEL
2019-04-10change marks[] array to uint64_t, so the code can track full 64-bitTheo de Raadt
details from the ELF header instead of faking it. Proposal from mlarkin, tested on most architectures already
2019-04-01fast track ddb> reboot command to skip anything which might panic again.Ted Unangst
ok deraadt
2019-03-24Add intr_{disable,restore}() for alpha.Visa Hankala
Reminded by deraadt@
2019-02-24Remove -S from install commandskn
As of usr.bin/xinstall/install.c revision 1.68, -S is a no-op and install(1) will always create files safely, thus clean the option usage from the tree. Diff from Lauri Tirkkonen <lotheac at iki dot fi>, thanks.
2018-12-05Include srp.h where struct cpu_info uses srp to avoid erroring out whenJonathan Gray
including cpu.h machine/intr.h etc without first including param.h when MULTIPROCESSOR is defined. ok visa@
2018-09-14Unify and bump some of the NMBCLUSTERS defines. Some archs had it set toClaudio Jeker
4MB which is far too low especially when the platform is able to run MP. New limits are, amd64 = 256M; arm64, mips64, sparc64 = 64M; alpha, arm, hppa, i386, powerpc = 32M; m88k, sh = 8M Still rather conservative numbers but much better than before. At least some hangs of arm64 build boxes was caused by this. OK kettenis@, visa@
2018-09-06fix whitespaceJonathan Gray
2018-08-22Enable uscom(4) where uslcom(4) is already present.Martin Pieuchot
Based on a submisison from Jan Klemkow.
2018-08-20Remove unused spllock().Visa Hankala
OK deraadt@ mpi@
2018-07-10Move from sendsig() to its callers the initsiginfo() calls andPhilip Guenther
instead of passing sendsig() the code+type+val, pass a siginfo_t* to copy from. Eliminate the indirection through struct emul for sendsig(); we no longer have a SunOS4-compat version of sendsig() ok deraadt@
2018-05-22Delete antique sigdebug definitionsPhilip Guenther
ok kettenis@
2018-04-20grammar fixes PTE's -> PTEsMike Larkin
ok guenther, jmc, tom, millert, deraadt
2018-04-12Implement MAP_STACK option for mmap(). Synchronous faults (pagefault andTheo de Raadt
syscall) confirm the stack register points at MAP_STACK memory, otherwise SIGSEGV is delivered. sigaltstack() and pthread_attr_setstack() are modified to create a MAP_STACK sub-region which satisfies alignment requirements. Observe that MAP_STACK can only be set/cleared by mmap(), which zeroes the contents of the region -- there is no mprotect() equivalent operation, so there is no MAP_STACK-adding gadget. This opportunistic software-emulation of a stack protection bit makes stack-pivot operations during ROPchain fragile (kind of like removing a tool from the toolbox). original discussion with tedu, uvm work by stefan, testing by mortimer ok kettenis
2018-04-09Fill in FRAME_PS after the fact. What a ridiculous design decision.Theo de Raadt
It would be better if this was filled in at trap time. ok guenther
2018-03-20Do not panic from ddb(4) when a lock requirement isn't fulfilled.Martin Pieuchot
Extend the logic already present for panic() to any DDB-related operation such that if ddb(4) is entered because of a fault or other trap it is still possible to call 'boot reboot'. While here stop printing splassert() messages as well, to not fill the buffer. ok visa@, deraadt@
2018-03-05#define _MAX_PAGE_SHIFT in MD _types.h as the maximum pagesize an archTheo de Raadt
needs (looking at you sgi, but others required this before). This is for the circumstances we need pagesize known at compile time, not getpagesize() runtime. Use it for malloc storage sizes, for shm, and to set pthread stack default sizes. The stack sizes were a mess, and pushing them towards page-aligned is healthy move (which will also be needed by the coming stack register checker) ok guenther kettenis, discussion with stefan
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@