summaryrefslogtreecommitdiff
path: root/sys/compat/linux
AgeCommit message (Collapse)Author
2017-10-21Include opt_user_ldt.h when needed.maxv
2017-10-19Always mask the 16 bits of the segregs in the trapframe. We don't zero-maxv
extend the uint64_t's when building it, so we're leaking 48 bits of kernel stack to userland. Having said that, it appears that I unintentionally fixed most of this issue in locore.S::rev1.127 - by building the frame with interrupts disabled, we are implicitly guaranteeing that the structure doesn't get overwritten by the kernel. Which means, we are leaking to userland data that comes from userland anyway. (still other places with this issue, but I'll fix them differently)
2017-10-15Use two separate functions: cpu_segregs32_zero and cpu_segregs64_zero. Themaxv
way segment registers work on amd64 will diverge between 32bit and 64bit LWPs.
2017-09-29Remove compat_linux from the autoload list, and add a sysctl to enable ormaxv
disable it - which defaults to disabled. The following command is now required to use linux binaries: sysctl -w emul.linux.enabled=1 After a discussion on tech-kern@. All the other ideas to reduce the attack surface have drawbacks, and this sysctl seems to be the best option.
2017-09-17Remove the second argument from USERMODE and KERNELMODE, it is unusedmaxv
now that we don't have vm86 anymore.
2017-08-28Remove the filesystem tracing featurekamil
This is a legacy interface from 4.4BSD, and it was introduced to overcome shortcomings of ptrace(2) at that time, which are no longer relevant (performance). Today /proc/#/ctl offers a narrow subset of ptrace(2) commands and is not applicable for modern applications use beyond simplistic tracing scenarios. This removal will simplify kernel internals. Users will still be able to use all the other /proc files. This change won't affect other procfs files neither Linux compat features within mount_procfs(8). /proc/#/ctl isn't available on Linux. Remove: - /proc/#/ctl from mount_procfs(8) - P_FSTRACE note from the documentation of ps(1) - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8) - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9) - source code file miscfs/procfs/procfs_ctl.c - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h - PSL_FSTRACE (0x00010000) from sys/sys/proc.h - P_FSTRACE (0x00010000) from sys/sys/sysctl.h Reduce code complexity after removal of this functionality. Update TODO.ptrace accordingly: remove two entries about /proc tracing. Do not keep legacy notes as comments in the headers about removed PSL_FSTRACE / P_FSTRACE, as this interface had little number of users (close or equal to zero). Proposed on tech-kern@. All filesystem tracing utility users are encouraged to switch to ptrace(2). Sponsored by <The NetBSD Foundation>
2017-08-12Remove vm86.maxv
Pass 3.
2017-08-12Remove vm86. Simplifies a number of critical places.maxv
Pass 2.
2017-07-29Put suser check in the right function: settimeofday, not gettimeofday.riastradh
While here, remove wrong comment. Noted by kre@.
2017-07-29Only let the superuser set the compat_linux timezone.riastradh
Not really keen to invent a new kauth cookie for this useless purpose. From Ilja Van Sprundel.
2017-07-28Fail, don't panic, on bad dirents from file system.riastradh
Controllable via puffs from userland. From Ilja Van Sprundel.
2017-07-14Don't forget to clean l_md.md_flags, otherwise there may be MDL_COMPAT32,maxv
in which case the kernel would always use iret (slower).
2017-05-10regenriastradh
2017-05-06Extend the mmap(2) interface to allow requesting protections for laterjoerg
use with mprotect(2), but without enabling them immediately. Extend the mremap(2) interface to allow duplicating mappings, i.e. create a second range of virtual addresses references the same physical pages. Duplicated mappings can have different effective protections. Adjust PAX mprotect logic to disallow effective protections of W&X, but allow one mapping W and another X protections. This obsoletes using temporary files for purposes like JIT. Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested and not silently drop the X protection. Improve test cases to ensure correct operation of the changed interfaces.
2017-05-03add missing arg to fpu_discard().chs
2017-04-21- Propagate the signal mask from the ucontext_t to the newly created threadchristos
as specified by _lwp_create(2) - Reset the signal stack for threads created with _lwp_create(2)
2017-04-10Return value pointers should be the last argument.dholland
2017-04-09speed limit 80dholland
2017-03-16allow pcu_save() and pcu_discard() to be called on other threads,chs
ptrace needs to use it that way.
2017-03-14Use if_acquire and if_release instead of using psref API directlyozaki-r
- Provide if_release for consistency to if_acquire - Use if_acquire and if_release for ifp iterations - Make ifnet_psref_class static
2017-02-20KNF; no binary changesrin
2017-02-20CID 980928: fix NULL pointer dereferecerin
2017-02-13Make sure %rip is in userland. This is harmless, since the return tomaxv
userland is made with iret instead of sysret in this path. While here, use size_t.
2017-02-13Don't let userland choose %rip. This is the Intel Sysret vulnerabilitymaxv
again.
2017-02-12es_arglen is now in units of bytes, update the emulations accordingly.chs
2017-02-09regenchristos
2017-02-09revert listenchristos
2017-02-09use proper arg functions, remove bogus ones.christos
2017-02-09regenchristos
2017-02-09fix listenchristos
2017-02-06Use ELFOSABI_LINUX instead of a magic number.uwe
2017-02-05Rename ldt->ldtstore and gdt->gdtstore on i386. It reduces the diff withmaxv
amd64, and makes it easier to track down these variables on nxr - 'ldt' and 'gdt' being common keywords.
2017-02-05Missing pmap_ldt_cleanup.maxv
2017-02-04regenchristos
2017-02-04fix broken entries that prevented compilation.christos
2017-02-03New versions of linux on arm and others have both socketcall and separatechristos
syscalls...
2017-02-03add sendmmsg and recvmmsgchristos
2017-02-03regenchristos
2017-02-03add unimple sendmmsg secvmmsgchristos
2017-02-03regenchristos
2017-02-03add missing unimpl and sendmmsg and recvmmsgchristos
2017-02-03regenchristos
2017-02-03and send and recv mmsg and unimplchristos
2017-02-03regenchristos
2017-02-03add send recv mmsg and unimplchristos
XXX: fix base?
2017-02-03regenchristos
2017-02-03add sendmmsg and recvmmsgchristos
2017-02-03regenchristos
2017-02-03add send/recv mmsg and comment on the unimpl ones.christos
2017-02-03handle accept4 for i386christos