kernel - Add per-process capability-based restrictions* This new system allows userland to set capability restrictions which turns off numerous kernel features and root accesses. These restricti
kernel - Add per-process capability-based restrictions* This new system allows userland to set capability restrictions which turns off numerous kernel features and root accesses. These restrictions are inherited by sub-processes recursively. Once set, restrictions cannot be removed. Basic restrictions that mimic an unadorned jail can be enabled without creating a jail, but generally speaking real security also requires creating a chrooted filesystem topology, and a jail is still needed to really segregate processes from each other. If you do so, however, you can (for example) disable mount/umount and most global root-only features.* Add new system calls and a manual page for syscap_get(2) and syscap_set(2)* Add sys/caps.h* Add the "setcaps" userland utility and manual page.* Remove priv.9 and the priv_check infrastructure, replacing it with a newly designed caps infrastructure.* The intention is to add path restriction lists and similar features to improve jailess security in the near future, and to optimize the priv_check code.
show more ...
kernel: Use NULL for pointers, not 0.
kernel/disk: Remove use of "%b" format.Switch to args safe "%pb%i" internal format.
fdc(4): Check return error from isa_dma_init().Must have been a bad sector in0bc821c68ba308f17d4f0a7bfd300c432d575a09Reported-by: dcb <https://bugs.dragonflybsd.org/issues/3108>
kernel: Make floppies work again.Revive the old x86 32bit only fdc(4) driver, it only needs just a few changes.The fdc was never ported to work on x86_64 DragonFly, so rather than remove ittogeth
kernel: Make floppies work again.Revive the old x86 32bit only fdc(4) driver, it only needs just a few changes.The fdc was never ported to work on x86_64 DragonFly, so rather than remove ittogether with its manpage, fix few things and hook it to LINT64 config so thatwe would keep track the state of it and not keep it in a dusty corner of sys/.On modern x86_64 systems fdc($) has little value and it is getting harder andharder to find floppy drives that work or even the motherboards that still havethe FDD headers to hook the 34pin ribbon cable, but I feel nostalgic about thescratching noises the floppy drive makes while performing the operations.So went through all storage closets and find one that works, blew out all theaccumulated dusts, cleaned the magnetic heads with a folder paper tissue good.The hardest part was to find a floppy disk. Only could find just a single onestashed away deep on the floor of a very old safe under heeps of old documents.For fdc(4) to actually work, some adjustmens to isa_dma.c were needed becauseof how ISA bus probing is done in platform/pc64/x86_64/autoconf.c. To workaround the exhaustion of low DMA memory before it gets to isa_probe_children()now try to preallocate contiguous buffer of 512KB and free it just before theprobe of ISA bus. This should help any legacy ISA drivers(including ppc(4))or even some of more picky drivers that are not built in into the kernel.For case where isa_dmainit() would still fail to allocate the buffer fittingthe requirements, have added the safety checks and explicit fallback to nonDMA mode by setting the FDC_NODMA flag to avoid panics on "bad bounce buffer".Floppy drive would not work properly, but it is this versus a panic. There areother issues too. For some reason some files tend to be read with stripes ofzeros, but write operations seems to work. Same floppy is readable on linux.Currently can not debug the issue cause my floppy had seen better days:_# time dd if=/dev/fd0 of=/tmp/recover.img conv=sync,noerror...dd: /dev/fd0: Input/output error2880+0 records in2880+0 records out1474560 bytes transferred in 80.723953 secs (18267 bytes/sec)while dmesg:fd0: hard error reading offset 00000000ae00 for 512 (ST0 40<abnrml> ST1 20<bad_crc> ST2 20<bad_crc> cyl 2 hd 0 sec 16)fd0: hard error reading offset 00000000f600 for 512 (ST0 40<abnrml> ST1 1<no_am> ST2 1<no_dam> cyl 3 hd 0 sec 16)fd0: hard error reading offset 000000113800 for 512 (ST0 40<abnrml> ST1 20<bad_crc> ST2 20<bad_crc> cyl 61 hd 0 sec 9)fd0: hard error reading offset 000000115c00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 10<wrong_cyl> cyl 61 hd 1 sec 9)fd0: hard error reading offset 00000011a400 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 62 hd 1 sec 9)fd0: hard error reading offset 00000011ec00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 63 hd 1 sec 9)fd0: hard error reading offset 000000123400 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 64 hd 1 sec 9)fd0: hard error reading offset 000000127c00 for 512 (ST0 44<abnrml,top_head> ST1 4<sec_not_fnd> ST2 0 cyl 65 hd 1 sec 9)Given the state of my single floppy I cannot even do a proper newfs_msdos(8).So maybe someone who has a collection of good floppies could give it a go.While there, hook old musycc(4) driver to LINT64, it was fixed in:906779c3d1e064e55bb019342ad6c1621cc04399
Remove advertising header from sys/Correct BSD License clause numbering from 1-2-4 to 1-2-3.Some less clear cases taken as it was done of FreeBSD.
Remove a bunch of unnecessary semicolons.
kernel: Generate miidevs.h, pccarddevs.h and pcidevs.h on the fly.It removes the need to regenerate those header file after first editingthe associated list of IDs (miidevs, pccarddevs or pcidevs)
kernel: Generate miidevs.h, pccarddevs.h and pcidevs.h on the fly.It removes the need to regenerate those header file after first editingthe associated list of IDs (miidevs, pccarddevs or pcidevs). After thiscommit, editing the list alone is enough to add IDs.We already did it like that for usb4bsd's usbdevs.h before. This commitadjusts things for the remaining ID lists.
kernel/dev: Remove some #include duplicates.
kernel: Use DEVMETHOD_END in the drivers.
Remove some emacs variable settings.
kernel: Remove some more old major number related stuff.
kernel: Remove two more major numbers.
i386: Unbreak LINT building
resource: Per-CPU hardware resources support, step 3 of many- Add cpuid parameter to bus_set_resource() and bus_set_resource DEVMETHOD; Pass this parameter to resource_list_add()- Obtain interru
resource: Per-CPU hardware resources support, step 3 of many- Add cpuid parameter to bus_set_resource() and bus_set_resource DEVMETHOD; Pass this parameter to resource_list_add()- Obtain interrupt resource's owner CPU, i.e. target CPU, from MachIntrABI and pass it to bus_set_resource(), so that the owner CPU of the interrupt resource could be correctly setup- Rest of types of resources, e.g. IOPORT, MEMORY and DRQ, are shared across CPUs, so their cpuids are set to -1
kernel: Use NULL for DRIVER_MODULE()'s evh & arg (which are pointers).This is just cosmetics for easier reading.
kernel: Fix some printf format warnings on x86_64.
kernel: Remove a number of unnecessary use_*.h inclusions.
udev - Tag some subsystems/drivers* While here, fix a number of bugs in the udev kernel implementation.
fd - Fix panic due to device_busy* Fix panic introduced by 7ba1363dc2de5d52704, caused by a too early call to device_busy, before the device is marked as attached.NOTE: This might have yet un
fd - Fix panic due to device_busy* Fix panic introduced by 7ba1363dc2de5d52704, caused by a too early call to device_busy, before the device is marked as attached.NOTE: This might have yet unknown repercussions on the use of floppies.Suggested-By: Matthew Dillon
disk/fd - fix panics* Call disk_setdiskinfo() on startup.* Adjust kernel to not panic if a disk device is opened before disk_setdiskinfo() has been called.
DEVFS - remove dev_ops_add(), dev_ops_get(), and get_dev()
DEVFS - Bring in Alex's GSOC kernel adjustments.This is a rollup commit bringing in Alex Hornung's GSOC adjustmentsto the main kernel codebase for DEVFS.Submitted-by: Alex Hornung <ahornung@gmai
DEVFS - Bring in Alex's GSOC kernel adjustments.This is a rollup commit bringing in Alex Hornung's GSOC adjustmentsto the main kernel codebase for DEVFS.Submitted-by: Alex Hornung <ahornung@gmail.com>
MPSAFE - tsleep_interlock, BUF/BIO, cluster, swap_pager.* tsleep_interlock()/tsleep() could miss wakeups during periods of heavy cpu activity. What would happen is code inbetween the two calls
MPSAFE - tsleep_interlock, BUF/BIO, cluster, swap_pager.* tsleep_interlock()/tsleep() could miss wakeups during periods of heavy cpu activity. What would happen is code inbetween the two calls would try to send an IPI (say, issue a wakeup()), but while sending the IPI the kernel would be forced to process incoming IPIs synchronous to avoid a deadlock. The new tsleep_interlock()/tsleep() code adds another TAILQ_ENTRY to the thread structure allowing tsleep_interlock() to formally place the thread on the appropriate sleep queue without having to deschedule the thread. Any wakeup which occurs between the interlock and the real tsleep() call will remove the thread from the queue and the later tsleep() call will recognize this and simply return without sleeping. The new tsleep() call requires PINTERLOCKED to be passed to tsleep so tsleep() knows that the thread has already been placed on a sleep queue.* Continue making BUF/BIO MPSAFE. Remove B_ASYNC and B_WANT from buf->b_flag and add a new bio->bio_flags field to the bio. Add BIO_SYNC, BIO_WANT, and BIO_DONE. Use atomic_cmpset_int() (aka cmpxchg) to interlock biodone() against biowait(). vn_strategy() and dev_dstrategy() call semantics now require that synchronous BIO's install a bio_done function and set BIO_SYNC in the bio.* Clean up the cluster code a bit.* Redo the swap_pager code. Instead of issuing I/O during the collection, which depended on critical sections to avoid races in the cluster append, we now build the entire collection first and then dispatch the I/O. This allows us to use only async completion for the BIOs, instead of a hybrid sync-or-async completion.
suser_* to priv_* conversion
123