summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2024-01-21For minherit(MAP_INHERIT_ZERO) upon readonly memory return EPERM.Theo de Raadt
ok kettenis
2024-01-21madvise(2) and msync(2) have some memory/mapping destructive ops which shouldTheo de Raadt
not be allowed upon immutable memory, instead return EPERM. Some of these ops are not destructive in OpenBSD, but they are destructive on other systems, so we take the "all ops" are illegal approach. Related to this, it should not be allowed to minherit(MAP_INHERIT_ZERO) immutable regions, or vice versa, calling mimmutable() upon MAP_INHERIT_ZERO regions, because such a range will be zero'd post-fork in the child. These now also return EPERM. Adjusting the madvise / msync behaviour upon immutable memory brings us closer to the behaviour of the mimmutable clone "mseal" being proposed by google for inclusion in Linux. ok kettenis
2024-01-21Add support for multiple matches in the component code.Mark Kettenis
ok jsg@
2024-01-21sync with userlandTheo Buehler
2024-01-21sync with userlandTheo Buehler
2024-01-21Print raw battery information if KB3310_DEBUG, not DEBUG. NFCMiod Vallat
2024-01-21Assert that inpcb table has correct address family.Alexander Bluhm
Since inpcb tables for UDP and Raw IP have been split into IPv4 and IPv6, assert that INP_IPV6 flag is correct instead of checking it. While there, give the table variable a nicer name. OK sashan@ mvs@
2024-01-21oops, brain scrambled trying to squeeze the ifdef into bad placeTheo de Raadt
2024-01-21some bizzare glitch related to ramdisk instbin static binaries, theirTheo de Raadt
mutable mapping is not working right, so temporarily bring back the RW -> R *only* for ramdisk kernels
2024-01-20vmm(4)/vmd(8)/vmctl(8): increase max VM mem size.Mike Larkin
MAXDSIZ was cranked to 128GB back in April 2023, but vmd(8) was limiting VM RAM size to the old value (32GB).
2024-01-20Early during mimmutable(2) development, we had a big problem with theTheo de Raadt
chrome v8_flags variable's placement in bss, and as a workaround made it possible to demote a mimmutable mapping's permissions from RW to R. Further mimmutable-related work in libc's malloc created the same problem, which led to a better design: objects could be placed into .openbsd.mutable region, and then at runtime their permission and immutability could be manipulated better. So the RW to R demotion logic is no longer being used, and now this semantic is being deleted. ok kettenis
2024-01-20AEXECVE can be removed, because pinsyscall SYS_execve detection hasTheo de Raadt
been deleted.
2024-01-20There are several DART variants; print some more details such that we canMark Kettenis
distinguish between them. Pay attention to the apple,dma-range property that tells us the desired DVA window. Add support for a new BUS_DMA_FIXED that allows use of bus_dmamap_load_raw(9) to map things at a pre-determined DVA. This last change is needed for the upcoming Apple KMS driver. Hopefully that is the only driver that will need this, so don't attempt to turn this into an MI feature. ok patrick@
2024-01-20Fetch touchpad dimensions from firmware here as well.Mark Kettenis
ok mlarkin@, tobhe@
2024-01-19Implement extent_alloc_region_with_descr(9) which is the equivalent ofMark Kettenis
extent_alloc_region(9) that uses a pre-allocated region descriptor. ok patrick@
2024-01-19remove the guts of pinsyscall(2), it just returns 0 now.Theo de Raadt
It has been made redundant by the introduction of pinsyscalls(2) which handles all system calls, rather than just 1.
2024-01-19ugly whitespaceTheo de Raadt
2024-01-19Implement Multiple Message MSI support on amd64. This is experimental codeMark Kettenis
to assist qwx(4) development. We may remove this code again at some point in the future. Multiple Message MSI has some serious design flaws, especially when combined with the APIC interrupt controller architecture. It was superseded by MSI-X. Unfortunately qwx(4) does not implement MSI-X. ok stsp@, deraadt@
2024-01-19Rename WSDISPLAY_TYPE_RKDRM to WSDISPLAY_TYPE_KMS such that we can use itMark Kettenis
for other generic KMS drivers. ok jsg@, matthieu@
2024-01-19add iwn(4) to arm64 GENERICMike Larkin
ok kettenis
2024-01-19consolidate pci and cardbus detach code, and have it detach kstats.David Gwynne
this solves one probably with an re(4) going away.
2024-01-19Add TSO support. Previous commit fixed up a bug that could only beJonathan Matthew
triggered with TCP socket splicing and TSO, and with that fixed, it works reliably. tested by hrvoje, jan@, mbuhl@, bluhm@, feedback from jan@ and bluhm@, ok jan@ mbuhl@ bluhm@
2024-01-19Unify inpcb API for inet and inet6.Alexander Bluhm
Many functions for IPv4 call their IPv6 counterpart if INP_IPV6 is set at the socket's pcb. By using the generic API consistently, the logic is not in the caller it gets more readable. OK mvs@
2024-01-19Backout priterator() for walking allprocess list.Alexander Bluhm
This approach does not work as LIST_NEXT() of a removed element does not return NULL. I causes a crash in syzcaller and triggers kernel diagnostic assertion "vp->v_uvcount == 0" in sys/kern/kern_unveil.c line 845 during reboot. Unfortunately the backout brings back the race in fill_file() and fstat(1) may crash the kernel. Reported-by: syzbot+54fba1c004d7383d5e85@syzkaller.appspotmail.com
2024-01-18Move the rtable_exists() check into in_pcbset_rtableid().Claudio Jeker
OK bluhm@ mvs@
2024-01-18reduce diff to linuxJonathan Gray
2024-01-18Use solock() instead of netlock within fill_file(). This makes allVitaliy Makkoveev
socket types protected. The netlock is still used while fill_file() called through *table.inpt_queue walkthroughs, but this is the inet sockets case. ok bluhm
2024-01-18Use `nowake' as tsleep_nsec(9) ident. It has no corresponding wakeup(9).Vitaliy Makkoveev
ok bluhm
2024-01-18remove duplicate defines, merge error from local patchesJonathan Gray
2024-01-18remove duplicate steam deck block, merge error from local patchesJonathan Gray
2024-01-18Instead of skipping the call to hdcp_destroy(), use NULL for the kobjectJonathan Gray
argument. Unused in the function itself as we define away sysfs_remove_bin_file().
2024-01-17Fix core file writing when a file map into memory has later been truncatedKurt Miller
to be smaller than the mapping. Record which memory segments are backed by vnodes while walking the uvm map and later suppress EFAULT errors caused by the underlying file being truncated. okay miod@
2024-01-17Since pinsyscalls(2) applies to all system calls and does a more preciseTheo de Raadt
check earlier, the pinsyscall(SYS_execve mechanism has become redundant. It needs to be removed delicately since ld.so and static binaries use it. As a first step, neuter the checking code in sys_execve(). Further steps will follow slowly. ok kettenis
2024-01-17unstub i915_driver_hw_remove()Jonathan Gray
2024-01-16update drm to linux 6.6.12Jonathan Gray
Thanks to the OpenBSD Foundation for sponsoring this work.
2024-01-16The kernel will now read pinsyscall tables out of PT_OPENBSD_SYSCALLS inTheo de Raadt
the main program or ld.so, and accept a submission of that information for libc.so from ld.so via pinsyscalls(2). At system call invocation, the syscall number is matched to the specific address it must come from. ok kettenis, gnezdo, testing of variations by many people
2024-01-16Fix clang warning about possible unaligned access on arm64.Kevin Lo
ok stsp@
2024-01-15Add support for bringing up RTKit while !cold.Mark Kettenis
ok tobhe@
2024-01-15Introduce priterator(), the `ps_list' iterator. Some of `allprocess'Vitaliy Makkoveev
list walkthroughs have context switch within, so make exit1() wait until the last reference released. Reported-by: syzbot+0e9dda76c42c82c626d7@syzkaller.appspotmail.com ok bluhm claudio
2024-01-15Fetch touchpad dimensions from firmware instead of hardcoding the valuesMark Kettenis
for the original 13" M1 MacBook. ok mlarkin@
2024-01-15We can't call kstat_create(9) when bringing up the secondary CPUs as itMark Kettenis
uses an rwlock and curproc isn't initialized yet for these CPUs at this point. As a result we hit a "locking against myself" panic if there is any lock contention. Fix this by adding a new ci_midr member to struct cpu_info which gets initialized when we identify the CPUs and use that to attach the kstat stuff. ok tobhe@, dlg@
2024-01-15The maximum number of ring slots a tx packet can use is 32, which isJonathan Matthew
indicated by writing 0 to the 5 bit 'BD count' field in the first slot. Accordingly, mask the value we're writing there. Each packet uses one slot for offload information and then one per DMA segment, which means the maximum number of DMA segments must be 31 rather than 32. Trying to send a packet using 33 slots makes the nic firmware very upset. ok dlg@
2024-01-15vio(4): poll device status after issuing device reset.Dave Voutila
The virtio spec says a driver "should" wait for a device to report a clear device status after performing a reset. In some hypervisors, this doesn't matter as the vcpu's io instruction emulation and virtio network device emulation happen serially in the same thread. In hypervisors like vmd(8), device reset happens asynchronously and the driver can't assume the device is ready. This race condition results in mbuf pool corruption, causing panics. Bug reported and reproduced by bluhm@. Root cause found and diff from sf@. ok dv@ and committed on sf@'s behalf with his permission.
2024-01-15clockintr: move CLST_IGNORE_REQUESTS from cl_flags to cq_flagsScott Soule Cheloha
In the near future, we will add support for destroying clockintr objects. When this happens, it will no longer be safe to dereference the pointer to the expired clockintr during the dispatch loop in clockintr_dispatch() after reentering cq_mtx. This means we will not be able to safely check for the CLST_IGNORE_REQUESTS flag. So replace the CLST_IGNORE_REQUESTS flag in cl_flags with the CQ_IGNORE_REQUESTS flag in cq_flags. The semantics are the same. Both cl_flags and cq_flags are protected by cq_mtx. Note that we cannot move the CLST_IGNORE_REQUESTS flag to cr_flags in struct clockrequest: that member is owned by the dispatching CPU and is not mutated with atomic operations.
2024-01-14sys/sched.h: conceal <sys/queue.h> inclusion from userspaceScott Soule Cheloha
Nothing outside of the _KERNEL guard in <sys/sched.h> needs <sys/queue.h>, so move its inclusion under _KERNEL. Requested by claudio@. Link: https://marc.info/?l=openbsd-tech&m=169937494818685&w=2 ok claudio@
2024-01-14sys/sched.h: conceal struct schedstate_percpu definition from userspaceScott Soule Cheloha
struct schedstate_perpcu contains struct clockintr pointers. struct clockintr is not defined in userspace, so move schedstate_percpu into the _KERNEL guard to hide it from userspace. Nothing in base userspace uses schedstate_percpu. Thread: https://marc.info/?l=openbsd-tech&m=169861224916185&w=2 ok claudio@ millert@
2024-01-13Provide a more complete implementation of the "component" APIs. Also tweakMark Kettenis
the "platform" interfaces to stash away the bits of fdt_attach_args that we need later on instead of referencing it directly. This makes those interfaces usable after attach time. ok jsg@
2024-01-12add license; ok kettenis@Jonathan Gray
2024-01-12Send UDP packets in parallel.Alexander Bluhm
Sending UDP packets via datagram socket is MP safe now. Same applies to raw IPv4 and IPv6, and divert sockets. Switch sosend() from exclusive net lock to shared net lock in combination with per socket lock. TCP and GRE still use exclusive net lock. tested by otto@ and florian@ OK mvs@
2024-01-12nfssvc: When the client disconnects, close the socket before sleeping.Alexandre Ratchov
If the server doesn't close the socket immediately and starts waiting for the client to reconnect, then the TCP connection will remain open. The client will have to wait for the connection to be closed in order to reconnect with the same source port; this never happens, resulting in a freeze until the file system is umounted. This change fixes Linux NFS clients freezing after 5 min of inactivity. ok miod, help from claudio