summaryrefslogtreecommitdiffstats
path: root/sys/kern (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* unbreak build on UP kernels.dlg2015-09-111-16/+8
| | | | found by deraadt@
* make srp use refcnts so it can use refcnt_finalize instead ofdlg2015-09-111-18/+7
| | | | sleep_setup/sleep_finish.
* use refcnts for the device reference counts as an example of howdlg2015-09-111-4/+4
| | | | refcnt(9) can be used.
* introduce a wrapper around reference counts called refcnt.dlg2015-09-111-1/+23
| | | | | | | | | | | | | | its basically atomic inc/dec, but it includes magical sleep code in refcnt_finalise that is better written once than many times. refcnt_finalise sleeps until all references are released and does so with sleep_setup and sleep_finalize, which is fairly subtle. putting this in now so i we can get on with work in the stack, a proper discussion about visibility and how available intrinsics should be in the kernel can happen after next week. with help from guenther@ ok guenther@ deraadt@ mpi@
* Hoist all the GPT header checks into gpt_chk_header(). Tweak remainingkrw2015-09-111-60/+64
| | | | | | logic a bit so that an invalid primary header/partition entries table does not cause readgptlabel() to exit before the secondary header is tried.
* Convert _TM_ flags to TAME_ flags, collapsing the entire mappingderaadt2015-09-114-213/+213
| | | | | | layer because the strings select the right options. Mechanical conversion. ok guenther
* Move all prototypes of gpt helper functions to top of file. Renamekrw2015-09-111-7/+7
| | | | get_fstype() to gpt_get_fstype() as it moves.
* Shuffle some variables around, add a couple, and eliminate hordeskrw2015-09-111-16/+20
| | | | | of repeated lehto32() and lehtoh64() in readgptlabel() to make code more readable.
* Move initialization of count of spoofed GPT partitions closerkrw2015-09-111-2/+3
| | | | to use.
* GPT partitions cannot start at offset 0. Eliminate the variablekrw2015-09-111-11/+10
| | | | | | | | | | tracking our discovery of the first OpenBSD partition (ourpart) and just use the variable holding the offset of the first OpenBSD partition (gptpartoff). Move initialization of gptpartoff and gptpartend closer to their use and set them when the first OpenBSD partition is found. Thus eliminating a later 'if' statement.
* remove some bits of srp.h i had pasted in here by accidentdlg2015-09-111-7/+1
|
* KNF shuffling of local declarations in readgptlabel().krw2015-09-111-9/+6
|
* The must be no space after the syslog priority in the sendsyslog(2)bluhm2015-09-111-2/+2
| | | | | dropped message error log. OK benno@
* readgptlabel() is called from readdoslabel() so there is no needkrw2015-09-111-6/+1
| | | | | for readgptlable() to re-check that the label d_secpercyl and d_secsize are not 0.
* Spoof EFI SYSTEM GPT partitions as MSDOS partitions. As is donekrw2015-09-111-2/+6
| | | | with MBR EFI SYSTEM partitions.
* Now that interrupt-safe uvm maps are porperly locked, the interrupt-safekettenis2015-09-111-5/+1
| | | | | | | multi page backend allocator implementation no longer needs to grab the kernel lock. ok mlarkin@, dlg@
* Eliminate use-once variable in readgptlabel() and just use thekrw2015-09-111-4/+2
| | | | function value the variable was being set to.
* Add ddb ps/o, displaying just the non-idle on-proc threadsguenther2015-09-111-8/+30
| | | | ok deraadt@
* Only include <sys/tame.h> in the .c files that need itguenther2015-09-118-8/+16
| | | | ok deraadt@ miod@
* Don't spoof GPT OpenBSD partitions. Simply record and use the first onekrw2015-09-111-2/+4
| | | | found, as is done in MBR processing.
* Change device locators type from int to long, for the sake of 64-bit portsmiod2015-09-111-57/+64
| | | | | | | | | without proper device trees. Be sure to build and install config(8) and rerun it before attempting to build a kernel. ok kettenis@ deraadt@ jasper@ visa@
* sizes for free(); ok sthenderaadt2015-09-102-6/+7
|
* Now that the GPT code tries really hard not to get in the way andkrw2015-09-101-11/+1
| | | | | | | | | | accidentally capture disks ... Eliminate kernel option GPT and associated #ifdef GPT/#endif. Let everybody get on the GPT bandwagon and we'll see what wheels fly off. Requested by & ok deraadt@
* Call readgptlabel() from readdoslabel() instead of MD readdisklabel().krw2015-09-101-1/+59
| | | | | | | | | | | | | Call it if and only if there is an MBR on sector 0 that contains 1 and only 1 partition; that partition is an EFI partition; and it covers the entire disk or as much of the disk as can be covered in an MBR partition. Be paranoid about restoring any possible tweaks to the label being built in the case that readgptlabel() fails, and in that case return to the readdoslabel() code. ok deraadt@
* Don't stop spoofing GPT partitions when the OpenBSD partition iskrw2015-09-101-4/+3
| | | | | found. Keep going until we spoof 8 or run out of partitions needing spoofing.
* No need to set d_npartitions in readdoslabel() or readgptlabel().krw2015-09-091-9/+1
| | | | | | | It has already been initialized in the MD readdisklabel() routines when they call initdisklabel(). ok deraadt@
* syncderaadt2015-09-092-4/+4
|
* Move to next tame() API. The flags are now passed as a very simple string,deraadt2015-09-092-5/+65
| | | | | | | | which results in tame() code placements being much more recognizeable. tame() can be moved to unistd.h and does not need cpp symbols to turn the bits on and off. The resulting API is a bit unexpected, but simplifies the mapping to enabling bits in the kernel substantially. vague ok's from various including guenther doug semarie
* implement a singly linked list built with SRPs.dlg2015-09-091-1/+15
| | | | | | | this allows us to build lists of things that can be followed by multiple cpus. ok mpi@ claudio@
* Give the pool page allocator backends more sensible names. We now have:kettenis2015-09-081-20/+19
| | | | | | | | * pool_allocator_single: single page allocator, always interrupt safe * pool_allocator_multi: multi-page allocator, interrupt safe * pool_allocator_multi_ni: multi-page allocator, not interrupt-safe ok deraadt@, dlg@
* Now that msleep(9) no longer requires the kernel lock (as long as PCATCHkettenis2015-09-081-15/+2
| | | | | | | isn't specified) the default backend allocator implementation no longer needs to grab the kernel lock. ok visa@, guenther@
* Delete ktracing of context switches: it's unused, and not particularly useful,guenther2015-09-072-27/+2
| | | | | | | and doing VOP_WRITE() from inside tsleep/msleep makes the locking too complicated, making it harder to move forward on MP changes. ok deraadt@ kettenis@
* We no longer need to grab the kernel lock for allocating and freeing pageskettenis2015-09-061-5/+11
| | | | | | | | | | in the (default) single page pool backend allocator. This means it is now safe to call pool_get(9) and pool_put(9) for "small" items while holding a mutex without holding the kernel lock as well as these functions will no longer acquire the kernel lock under any circumstances. For "large" items (where large is larger than 1/8th of a page) this still isn't safe though. ok dlg@
* Make every subsystem using a radix tree call rn_init() and pass thempi2015-09-042-4/+6
| | | | | | | | | | | | | | | length of the key as argument. This way every consumer of the radix tree has a chance to explicitly initialize the shared data structures and no longer rely on another subsystem to do the initialization. As a bonus ``dom_maxrtkey'' is no longer used an die. ART kernels should now be fully usable because pf(4) and IPSEC properly initialized the radix tree. ok chris@, reyk@
* Fix !INET6 build.mpi2015-09-031-2/+5
|
* To make logging to local syslog reliable, log a message about failedbluhm2015-09-021-4/+40
| | | | | | log atempts. sendsyslog(2) is a good place to detect and report the problem. OK deraadt@
* the special check logic for /usr/share/nls/../libc.cat became failurederaadt2015-09-011-3/+3
| | | | | | to return failure. open() of these paths should succeed to satisfy strerror() and friends. ok semarie
* Corrects a use-after-free in tame_namei().semarie2015-09-011-2/+2
| | | | ok doug@
* Push down the KERNEL_LOCK/KERNEL_UNLOCK calls into the back-end allocatorkettenis2015-09-011-7/+21
| | | | | | | | | functions. Note that these calls are deliberately not added to the special-purpose back-end allocators in the various pmaps. Those allocators either don't need to grab the kernel lock, are always called with the kernel lock already held, or are only used on non-MULTIPROCESSOR platforms. pk tedu@, deraadt@, dlg@
* mattieu baptiste reported a problem with bpf+srps where the per cpudlg2015-09-011-19/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hazard pointers were becoming corrupt and therefore panics. the problem turned out to be that bridge_input calls if_input on behalf of a hardware interface which then calls bpf_mtap at splsoftnet, while the actual hardware nic calls if_input and bpf_mtap at splnet. the hardware interrupts ran in the middle of the bpf calls bridge runs at softnet. this means the same srps are being entered and left on the same cpu at different ipls, which led to races because of the order of operations on the per cpu hazard pointers. after a lot of experimentation, jmatthew@ figured out how to deal with this problem without introducing per cpu critical sections (ie, splhigh) calls in srp_enter and srp_leave, and without introducing atomic operations. the solution is to iterate forward through the array of hazard pointers in srp_enter, and backward in srp_leave to clear. if you guarantee that you leave srps in the reverse order to entering them, then you can use the same set of SRPs at different IPLs on the same CPU. the ordering requirement is a problem if we want to build linked data structures out of srps because you need to hold a ref to the current element containing the next srp to use it, before giving up the current ref. we're adding srp_follow() to support taking the next ref and giving up the current one while preserving the structure of the hazard pointer list. srp_follow() does this by reusing the hazard pointer for the current reference for the next ref. both mattieu baptiste and jmatthew@ have been hitting this pretty hard with a tweaked version of srp+bpf that uses srp_follow instead of interleaved srp_enter/srp_leave sequences. neither can reproduce the panics anymore. thanks to mattieu for the report and tests ok jmatthew@
* a white space krw could not seederaadt2015-09-011-2/+2
|
* 'bogous' is bogus spelling of 'bogus' in debug message.krw2015-09-011-2/+2
|
* Missing letoh64() when checking value of gh_lba_alt.krw2015-09-011-2/+2
|
* Consider getfsstat() a RPATH, even though it has no path in it. We mayderaadt2015-08-311-1/+5
| | | | | | want to do the same for fstatfs(), after we handle statfs(). These system calls leak path information, however I am reluctant to add a seperate catagory.
* In tame mode, return EPERM for *chown if uid/gid change is not towardsderaadt2015-08-311-4/+22
| | | | | cr_uid/cr_gid (effective ids). Thus, chown(, -1,-1) should work OK, so should chown(, me, -1), etc. With this commited, more people can test.
* Rather than killing when *chmod is asked to do setuid/setgid, clearderaadt2015-08-311-7/+5
| | | | | those bits in the request and continue. This is a better posix-subset to give to programs.
* Abstract 5 identical code blocks into a readdisksector() function.krw2015-08-311-42/+31
| | | | | | | | | Cleaner, clearer and less error prone. Tested by bmercer@ as part of a larger diff, of which this is the last part. reads ok to jsing@ kettenis@. ok deraadt@.
* Rejig the the expression calculating of the address of the diskkrw2015-08-311-5/+5
| | | | | | | | | sector containing the disklabel, eliminating an unnecessary " * DL_BLKSPERSEC()". Tested by bmercer@ as part of larger diff. Idea from & reads ok to jsing@. ok kettenis@.
* spaces snuck inderaadt2015-08-311-13/+12
|
* KNFderaadt2015-08-311-5/+3
|