summaryrefslogtreecommitdiff
path: root/sys/kern
AgeCommit message (Collapse)Author
2015-09-25Don't immediately try to checksum the GPT header using the sizeKenneth R Westerback
field from the GPT header being checksum'd. First make sure the size is in a valid range. In particular ensure it won't cause crc32() to run off the end of the GPT header being checksum'd. Also check GPT signature and version first. These checks were inadvertantly moved after the checksumming. This should fix the system crash reported by Ze Loff on bugs@.
2015-09-24buglet: there's no way for req to be STEP in the DETACH case.Ted Unangst
also fix the confusing comment. ok guethner.
2015-09-24Move declaration of readdisksector() to disklabel.h. This makes itKenneth R Westerback
available to other areas of the kernel suffering from an overburden of buf tweaking to read a disk sector. ok mpi@
2015-09-24A couple of missing letoh32() conversions of GPT header fields inKenneth R Westerback
gpt_chk_hdr() and gpt_chk_parts(). Spotted when investigating zeloff's GPT bug report.
2015-09-20Short circuit if we're running on the CPU that we want to sync with. FixesMark Kettenis
suspend on machines with em(4) now that it uses intr_barrier(9). ok krw@
2015-09-19In the internal conversion of _TM_* to TAME_*, some bits were lost forSebastien Marie
"dns" and "cmsg" in the `tamereq' array. Restore the previous behaviour. ok guenther@
2015-09-15Unbeak boot from GPT partition. Reported by Henrik Friedrichsen.YASUOKA Masahiko
ok krw
2015-09-13syncPhilip Guenther
2015-09-13Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerPhilip Guenther
necessary ok deraadt@ jsing@
2015-09-13Move prototype for spoofgptlabel() from disklabel.h to subr_disk.c.Kenneth R Westerback
It's a helper function for readdoslabel(). Not something called outside of subr_disk.c.
2015-09-13Rename readgptlabel() to spoofgptlabel() because that's what weKenneth R Westerback
really want it to do. Handle all the actual disklabel reading in readdoslabel(). Makes the code much simpler to understand. ok deraadt@
2015-09-13Introduce sched_barrier(9), an interface that acts as a scheduler barrier inMark Kettenis
the sense that it guarantees that the specified CPU went through the scheduler. This also guarantees that interrupt handlers running on that CPU will have finished when sched_barrier() returns. ok miod@, guenther@
2015-09-11back out refcnt for dv_ref, there's too many hand crafted devices allDavid Gwynne
over the tree. much encouragement from l2k15
2015-09-11unbreak build on UP kernels.David Gwynne
found by deraadt@
2015-09-11make srp use refcnts so it can use refcnt_finalize instead ofDavid Gwynne
sleep_setup/sleep_finish.
2015-09-11use refcnts for the device reference counts as an example of howDavid Gwynne
refcnt(9) can be used.
2015-09-11introduce a wrapper around reference counts called refcnt.David Gwynne
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@
2015-09-11Hoist all the GPT header checks into gpt_chk_header(). Tweak remainingKenneth R Westerback
logic a bit so that an invalid primary header/partition entries table does not cause readgptlabel() to exit before the secondary header is tried.
2015-09-11Convert _TM_ flags to TAME_ flags, collapsing the entire mappingTheo de Raadt
layer because the strings select the right options. Mechanical conversion. ok guenther
2015-09-11Move all prototypes of gpt helper functions to top of file. RenameKenneth R Westerback
get_fstype() to gpt_get_fstype() as it moves.
2015-09-11Shuffle some variables around, add a couple, and eliminate hordesKenneth R Westerback
of repeated lehto32() and lehtoh64() in readgptlabel() to make code more readable.
2015-09-11Move initialization of count of spoofed GPT partitions closerKenneth R Westerback
to use.
2015-09-11GPT partitions cannot start at offset 0. Eliminate the variableKenneth R Westerback
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.
2015-09-11remove some bits of srp.h i had pasted in here by accidentDavid Gwynne
2015-09-11KNF shuffling of local declarations in readgptlabel().Kenneth R Westerback
2015-09-11The must be no space after the syslog priority in the sendsyslog(2)Alexander Bluhm
dropped message error log. OK benno@
2015-09-11readgptlabel() is called from readdoslabel() so there is no needKenneth R Westerback
for readgptlable() to re-check that the label d_secpercyl and d_secsize are not 0.
2015-09-11Spoof EFI SYSTEM GPT partitions as MSDOS partitions. As is doneKenneth R Westerback
with MBR EFI SYSTEM partitions.
2015-09-11Now that interrupt-safe uvm maps are porperly locked, the interrupt-safeMark Kettenis
multi page backend allocator implementation no longer needs to grab the kernel lock. ok mlarkin@, dlg@
2015-09-11Eliminate use-once variable in readgptlabel() and just use theKenneth R Westerback
function value the variable was being set to.
2015-09-11Add ddb ps/o, displaying just the non-idle on-proc threadsPhilip Guenther
ok deraadt@
2015-09-11Only include <sys/tame.h> in the .c files that need itPhilip Guenther
ok deraadt@ miod@
2015-09-11Don't spoof GPT OpenBSD partitions. Simply record and use the first oneKenneth R Westerback
found, as is done in MBR processing.
2015-09-11Change device locators type from int to long, for the sake of 64-bit portsMiod Vallat
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@
2015-09-10sizes for free(); ok sthenTheo de Raadt
2015-09-10Now that the GPT code tries really hard not to get in the way andKenneth R Westerback
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@
2015-09-10Call readgptlabel() from readdoslabel() instead of MD readdisklabel().Kenneth R Westerback
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@
2015-09-10Don't stop spoofing GPT partitions when the OpenBSD partition isKenneth R Westerback
found. Keep going until we spoof 8 or run out of partitions needing spoofing.
2015-09-09No need to set d_npartitions in readdoslabel() or readgptlabel().Kenneth R Westerback
It has already been initialized in the MD readdisklabel() routines when they call initdisklabel(). ok deraadt@
2015-09-09syncTheo de Raadt
2015-09-09Move to next tame() API. The flags are now passed as a very simple string,Theo de Raadt
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
2015-09-09implement a singly linked list built with SRPs.David Gwynne
this allows us to build lists of things that can be followed by multiple cpus. ok mpi@ claudio@
2015-09-08Give the pool page allocator backends more sensible names. We now have:Mark Kettenis
* 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@
2015-09-08Now that msleep(9) no longer requires the kernel lock (as long as PCATCHMark Kettenis
isn't specified) the default backend allocator implementation no longer needs to grab the kernel lock. ok visa@, guenther@
2015-09-07Delete ktracing of context switches: it's unused, and not particularly useful,Philip Guenther
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@
2015-09-06We no longer need to grab the kernel lock for allocating and freeing pagesMark Kettenis
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@
2015-09-04Make every subsystem using a radix tree call rn_init() and pass theMartin Pieuchot
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@
2015-09-03Fix !INET6 build.Martin Pieuchot
2015-09-02To make logging to local syslog reliable, log a message about failedAlexander Bluhm
log atempts. sendsyslog(2) is a good place to detect and report the problem. OK deraadt@
2015-09-01the special check logic for /usr/share/nls/../libc.cat became failureTheo de Raadt
to return failure. open() of these paths should succeed to satisfy strerror() and friends. ok semarie