summaryrefslogtreecommitdiff
path: root/sys/compat/linux32/arch
AgeCommit message (Collapse)Author
2023-06-20linux32_rt_sendsig: Memset zero before copyout.riastradh
Not sure if there's any padding here, but it's a pretty big structure, fairly likely, so let's be rather safe than sorry. XXX pullup-8 XXX pullup-9 XXX pullup-10
2023-04-09compat_linux32: KASSERT(A && B) -> KASSERT(A); KASSERT(B)riastradh
2021-12-03Fixed a bug in sigreturn that sigmask was not restored.ryo
2021-12-02regenryo
2021-12-02add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32ryo
2021-11-27regenryo
2021-11-27Add pselect6(2) system call to COMPAT_LINUX32ryo
2021-11-26- LINUX_GO_RT0_SIGNATURE for compat_linux is no longer enabled by default.ryo
it is now defined in each arch same as the other *_SIGNATURE definitions. - add new LINUX32_GO_RT0_SIGNATURE for compat_linux32, and is defined in amd64 and aarch64.
2021-11-25add support COMPAT_LINUX32 for aarch64ryo
2021-11-25Extra arguments for AT_HWCAP and AT_PLATFORM are now passed when executing ↵ryo
linux32 binaries. AT_SYSINFO (vsyscall) feature seems to be broken, so leave it commented out.
2021-11-25The default name of the `exec_setup_stack' function for linux32 should be ↵ryo
`linux32_exec_setup_stack', and it should be defined in each arch. declaration of linux32_exec_setup_stack() in linux32/amd64 has been removed because it does not exist. NFC.
2021-11-25- Use LINUX32_F_xxx instead of LINUX_F_xxx for compat_linux32.ryo
aarch64 and arm have different values. - Compile linux32_sys_fadvise64() only if the syscall is required.
2021-11-01Use "stack_t" instead of "struct sigaltstack", as the former is thethorpej
newer standardized name. NFC.
2021-09-20Regen for preadv(2) / pwritev(2).thorpej
2021-09-20Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-20Regen for eventfd.thorpej
2021-09-20Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-19Regen for timerfd.thorpej
2021-09-19Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-19Regen for POSIX timer syscalls.thorpej
2021-09-19Add the POSIX timer syscalls (timer_create(), timer_settime(), timer_gettime(),thorpej
timer_getoverrun(), and timer_delete()) to COMPAT_LINUX and COMPAT_LINUX32.
2021-09-19Add routines to convert from linux32 to native sigevent_t.thorpej
2021-09-07sys/compat: Memset zero before copyout.riastradh
Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2020-04-26Regen for native futex calls.thorpej
2020-04-26Add a NetBSD native futex implementation, mostly written by riastradh@.thorpej
Map the COMPAT_LINUX futex calls to the native ones.
2019-11-09regenjdolecek
2019-11-09add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;jdolecek
this is needed so that glibc falls back to emulation and apps behaving properly, since EOPNOTSUPP is a documented and expected return code, but ENOSYS is not right now there are no filesystems in NetBSD tree supporting the fallocate VOP, so no point trying to map this to a native call supposed to help with problem reported in https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html
2019-05-19Renamemaxv
fpu_save_area_clear -> fpu_clear fpu_save_area_reset -> fpu_sigreset Clearer, and reduces a future diff. No real functional change.
2019-03-24Disable preemption when setting PCB_COMPAT32, to prevent a context switchmaxv
before cpu_fsgs_reload() finishes, otherwise we write garbage in the GDT. On NetBSD-current it is harmless, however in NetBSD-8 it might cause panics, because NetBSD-8 uses the old SegRegs model and under this model we reload %fs and %gs during switches.
2018-08-10Regenpgoyette
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-10-15Make sure the 32bit LWPs don't have MDL_IRET set. That's not a problemmaxv
right now, but will be in the future.
2017-09-02Fix a subtle ring0 escalation vulnerability in amd64, and implement amaxv
mitigation against similar bugs. The operations on segment registers can generate a page fault if there is an issue when touching the in-memory gdt. Theoretically, it is never supposed to happen, since the gdt is mapped correctly. However, in the kernel we allow the gdt to be resized, and to do that, we allocate the maximum amount of va needed by it, but only kenter a few pages until we need more. Moreover, to avoid reloading the gdt each time we grow it, the 'size' field of gdtr is set to the maximum value. All of this means that if a mov or iretq is done with a segment register whose index hits a page that has not been kentered, a page fault is sent. Such a page fault, if received in kernel mode, does not trigger a swapgs on amd64; in other words, the kernel would be re-entered with the userland tls. And there just happens to be a place in compat_linux32 where the index of %cs is controlled by userland, making it easy to trigger the page fault and get kernel privileges. The mitigation simply consists in abandoning the gdt_grow mechanism and allocating/kentering the maximum size right away, in such a way that no page fault can be triggered because of segment registers.
2017-05-10regenriastradh
2017-04-26catch up with unit fixes for es_arglen; consistently use bytes.christos
2017-02-05Remove #if 0 on USER_LDT.maxv
2017-01-16descend and regenchristos
2017-01-13regenchristos
2016-09-02Fix argument (does not compile anyway).maxv
2015-03-08regenchristos
2015-03-08fix inconsistent nameschristos
2015-03-07regenchristos
2015-03-07Add systrace output filechristos
2014-11-22Regen for ppoll(2)njoly
2014-11-22Add ppoll(2) for compat linux32.njoly
2014-05-29Regen for utimes(2).njoly
2014-05-29Add utimes(2) support.njoly
2014-05-04Regen for pread/pwrite 64bit offset argument.njoly