summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2019-12-01Remove unused test program.Visa Hankala
OK deraadt@
2019-11-30temporarily neuter the syscall-callfrom check as a few peopleTheo de Raadt
haven't crossed over the ABI break as easily as expected.
2019-11-30cardbus(4): tsleep(9) -> tsleep_nsec(9); ok jca@cheloha
2019-11-30pckbc(4): tsleep(9) -> tsleep_nsec(9); ok jca@cheloha
2019-11-30onewire(4), owtemp(4): tsleep(9) -> tsleep_nsec(9); ok jca@cheloha
2019-11-30utwitch(4): tsleep(9) -> tsleep_nsec(9); ok jca@cheloha
2019-11-30Move kernel locking inside the sleep machinery. This enables callingVisa Hankala
rwsleep(9) with PCATCH and rw_enter(9) with RW_INTR without the kernel lock. In addition, now tsleep(9) with PCATCH should be safe to use without the kernel lock if the sleep is purely time-based. Tested by anton@, cheloha@, chris@ OK anton@, cheloha@
2019-11-29Fix size of reserved bytes section in xsave header.mortimer
ok guenther@ kettenis@
2019-11-29Add uvm_objfree function to free all pages in a uvm_obj in one go.Bob Beck
Use this in the buffer cache to free all the pages from a buffer, resulting in a considerable speedup when throwing away pages from the buffer cache. Lots of work done with mlarkin and kettenis ok kettinis@ deraadt@
2019-11-29Change the default security level for incoming IPsec flows fromtobhe
isakmpd and iked to REQUIRE. Filter policy violations earlier. ok sashan@ bluhm@
2019-11-29Improve support for the RK3399's eMMC in sdhc(4). Fix the compatiblePatrick Wildt
check for the quirk that makes sure we don't try to change the voltage to anything else. Configure the eMMC Core's clock, register ourselves as clock driver for rkemmcphy(4) to use, and enable the PHY. Tested by kurt@ ok kettenis@
2019-11-29Add rkemmcphy(4), a driver for the RK3399's eMMC PHY.Patrick Wildt
2019-11-29Make rkgrf(4) behave like a simplebus(4) so we can attach driversPatrick Wildt
to its subnodes, which are some PHYs. Tested by kurt@ ok kettenis@
2019-11-29Add support for the RK3399's eMMC clock to rkclock(4).Patrick Wildt
Tested by kurt@ ok kettenis@
2019-11-29Move p_sleeplocks and p_limit into the "zero on create" section of structPhilip Guenther
proc, so they don't need to be explicitly initialized in thread_new() suggested by anton@ ok kettenis@
2019-11-29Eliminate the sketchy use of ps_mainproc here by making unveil_add_vnode()Philip Guenther
take a struct proc* instead of a struct process*, and vice versa making unveil_lookup() take a process* instead of a proc*. ok beck@
2019-11-29Add an element to the marks array to store the virtual address of theMark Kettenis
entry point. ok mlarkin@, deraadt@
2019-11-29Move kcov(4)'s p_kd into the "zero on create" section to simplify fork codePhilip Guenther
ok anton@
2019-11-29Split out the code that removes a page from uvm objects and clears the flagsMark Kettenis
into a separate uvm_pageclean() function and call it from uvm_pagefree(). ok mpi@, guenther@, beck@
2019-11-29Add missing retq to mds handler for knights landing.mortimer
ok guenther@
2019-11-29add __func__ to panic() and printf() calls in sys/netinet6/*Nayden Markatchev
ok benno@ mortimer@
2019-11-29Pass the EFI memory map to the kernel.Mark Kettenis
ok deraadt@
2019-11-29add missing parens around return expression and zap empty lineanton
2019-11-29DISK_PGCODE() #define includes a check for NULL, so no need toKenneth R Westerback
do the same check before invoking it.
2019-11-29Start protecting the pipe_busy field of struct pipe using a globalanton
rwlock. This lock is shared among all pipes for simplicity. In the future, the lock will probably be replaced with one lock per pipe pair, just like FreeBSD and NetBSD does. While here, extract the common rundown wakeup logic into a dedicated function. Thanks to cheloha@ for testing and feedback. ok mpi@ visa@
2019-11-29Add defines for changer mode page codes. Move AUDIO_PAGE define toKenneth R Westerback
nestle amoung its friends.
2019-11-29timeout(9): make CIRCQ look more like other sys/queue.h data structurescheloha
- CIRCQ_APPEND -> CIRCQ_CONCAT - Flip argument order of CIRCQ_INSERT to match e.g. TAILQ_INSERT_TAIL - CIRCQ_INSERT -> CIRCQ_INSERT_TAIL - Add CIRCQ_FOREACH, use it in ddb(4) when printing buckets - While here, use tabs for indentation like we do with other macros ok visa@
2019-11-29Return EBUSY for successive PT_TRACE_ME calls.Martin Pieuchot
Match FreeBSD and NetBSD. ok bluhm@, deraadt@, kettenis@
2019-11-29Use RW_PROC() consistently.Martin Pieuchot
Suggested by and ok sashan@
2019-11-29Repurpose the "syscalls must be on a writeable page" mechanism toTheo de Raadt
enforce a new policy: system calls must be in pre-registered regions. We have discussed more strict checks than this, but none satisfy the cost/benefit based upon our understanding of attack methods, anyways let's see what the next iteration looks like. This is intended to harden (translation: attackers must put extra effort into attacking) against a mixture of W^X failures and JIT bugs which allow syscall misinterpretation, especially in environments with polymorphic-instruction/variable-sized instructions. It fits in a bit with libc/libcrypto/ld.so random relink on boot and no-restart-at-crash behaviour, particularily for remote problems. Less effective once on-host since someone the libraries can be read. For static-executables the kernel registers the main program's PIE-mapped exec section valid, as well as the randomly-placed sigtramp page. For dynamic executables ELF ld.so's exec segment is also labelled valid; ld.so then has enough information to register libc's exec section as valid via call-once msyscall(2) For dynamic binaries, we continue to to permit the main program exec segment because "go" (and potentially a few other applications) have embedded system calls in the main program. Hopefully at least go gets fixed soon. We declare the concept of embedded syscalls a bad idea for numerous reasons, as we notice the ecosystem has many of static-syscall-in-base-binary which are dynamically linked against libraries which in turn use libc, which contains another set of syscall stubs. We've been concerned about adding even one additional syscall entry point... but go's approach tends to double the entry-point attack surface. This was started at a nano-hackathon in Bob Beck's basement 2 weeks ago during a long discussion with mortimer trying to hide from the SSL scream-conversations, and finished in more comfortable circumstances next to a wood-stove at Elk Lakes cabin with UVM scream-conversations. ok guenther kettenis mortimer, lots of feedback from others conversations about go with jsing tb sthen
2019-11-29drm_sched_entity_flush() doesn't care about specific threads, so justPhilip Guenther
track the process (and not the original thread of the process). ok jsg@ kettenis@
2019-11-29Re commit what was committed in version 1.43 with a fix added toBob Beck
ensure we handle the uvm_objects of bread_cluster buffers correctly. Original commit message: Fix the buffer cache code to not use a giant uvm obj of all pages when a small one on each buf is all that is needed. reduces the cost of large frees by about 25%. Again, lots of assistence from kettenis and mlarkin still ok kettenis@
2019-11-28uvm_pagealloc_contig() doesn't exist and shouldn't existPhilip Guenther
ok kettenis@
2019-11-28On short transfers with multiple TRBs in a TD we get two events.Patrick Wildt
One on the TRB that went short, and one for the last TRB in a TD. We already set actlen only once so that the last TRB in a TD does not override it, but some controllers throw another short event instead of a success event, so we have to add the same check there as well. ok gerhard@ mglocker@
2019-11-28back out the buffer cache uvm_obj change for now.Bob Beck
the bread_cluster code has confused even me and mark, we need to handle the buffer slice and dice case better for bread_cluster.
2019-11-28Abstract mode sense block descriptor parsing into a separate function.Kenneth R Westerback
2019-11-28Remove end of line whitespace.Mike Larkin
No code change.
2019-11-28Align an annoying comment.Kenneth R Westerback
2019-11-28Always pass a pointer to 'big' to scsi_do_mode_sense().Kenneth R Westerback
Sets up some simplifications.
2019-11-28Delete km_mapblocks from kmemstats and its always-zero column from the ddbPhilip Guenther
"show malloc" output ok deraadt@ mpi@
2019-11-28Fix panic noticed by bluhm@ and florian@. bp->b_pobj is usedBob Beck
to determine if the buffer has pages to free. we have to set this pointer only after we could sleep allocating pages. setting it before creates the potential for a race to free us while we are sleeping ok kettenis@
2019-11-28struct execsw's es_emul is no longer used, so delete itPhilip Guenther
ok deraadt@
2019-11-28Fix the buffer cache code to not use a giant uvm obj of all pagesBob Beck
when a small one on each buf is all that is needed. reduces the cost of large frees by about 25%. ok kettenis@
2019-11-28Although ifconfig(8) checks it already, enforce contiguous inetAlexander Bluhm
netmask in the kernel. OK visa@
2019-11-28Implement a hexdump command in the boot loader. This helps toAlexander Bluhm
inspect the memory layout that the firmware has created. It is especially useful for UEFI debugging. OK deraadt@ kettenis@
2019-11-27use correct forward type declaration from uvm.Bob Beck
ok kettenis@
2019-11-27OpenFlow 1.3 defines packet header patterns of interest using TLVs (OXMs)akoshibe
that represent various header fields. One place where OXMs are used is in the sef_field action, which contains one OXM representing the header field to set, followed by padding to align the action in the OpenFlow message to 64 bits. Currently, we assume that a set_field action can contain multiple OXMs and that they do not need to be padded. This matches the way we handle OpenFlow messages that contain set_field actions so that we follow the specs. OK ori claudio
2019-11-27Reinstate monitor mode support in iwm(4).Stefan Sperling
Monitor mode depends on support for multiple frames per Rx buffer.
2019-11-27Add support for Rx buffers containing multiple frames to iwm(4), again.Stefan Sperling
Tested by florian on 7260, claudio and myself on 8265, and mlarkin on 9560. This time even florian's 7260 device seems to be happy. ok claudio@
2019-11-27Re-enable IO_NOCACHE, and use is in vnd.Bob Beck
Ensure that io to a file backing a vnd is IO_SYNC, so IO to a vnd device is both synchronous and not cached in the buffer cache. This allows the "mount" regress to work repeatably, and avoids a situation where when the buffer cache cleaner runs to clear dirty buffers while people are waiting, it actually increases the dirty buffers when the writes to the underlying vnd are also delayed. ok bluhm@