summaryrefslogtreecommitdiff
path: root/sys/compat/linux32
AgeCommit message (Collapse)Author
2018-01-09remove struct emul's e_fault.maya
It used to be used by COMPAT_IRIX for the purpose of overriding uvm_fault (only implemented in MIPS), now removed. Ride 8.99.12 version bump.
2018-01-07ignore signal 64 for now (go uses it)christos
XXX: pullup-8
2017-12-26Refactor pipe1() and correct a bug in sys_pipe2() (SYS_pipe2)kamil
sys_pipe2() returns two integers (values), the 2nd one is a copy of the 2nd file descriptor that lands in fildes[2]. This is a side effect of reusing the code for sys_pipe() (SYS_pipe) and not cleaning it up. The first returned value is (on success) 0. Introduced a small refactoring in pipe1() that it does not operate over retval[], but on an array int[2]. A user sets retval[] for pipe() when desired and needed. This refactoring touches compat code: netbsd32, linux, linux32. Before the changes on NetBSD/amd64: $ ktruss -i ./a.out [...] 15131 1 a.out pipe2(0x7f7fff2e62b8, 0) = 0, 4 [...] After the changes: $ ktruss -i ./a.out [...] 782 1 a.out pipe2(0x7f7fff97e850, 0) = 0 [...] There should not be a visible change for current users. Sponsored by <The NetBSD Foundation>
2017-12-10Finally (hopefully) return completely to the state where compat_linux iskre
enabled by default. While here make it possible to enable this if already enabled, or disable if already disabled, without error. Some minor KNF.
2017-12-08Finish the previous change - as well as setting the default for thesekre
compat modules back to enabled, stop forcing it to switch back to disabled any time the module is init'd (which is truly barbaric behaviour.)
2017-12-01Unbreak Linux emulation by default. While not loading it automaticallyjoerg
is somewhat sensible, breaking functionality of GENERIC is not and has been objected to on a regular base.
2017-11-22Fix and make consistent of usages of psz/psref in ifconf variantsozaki-r
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-29Remove compat_linux32 from the autoload list and add a enable/disablemaxv
sysctl, like compat_linux.
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-07-28Fail, don't panic, on bad dirents from file system.riastradh
Controllable via puffs from userland. From Ilja Van Sprundel.
2017-05-10regenriastradh
2017-04-26catch up with unit fixes for es_arglen; consistently use bytes.christos
2017-04-10Return value pointers should be the last argument.dholland
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-05Remove #if 0 on USER_LDT.maxv
2017-01-28avoid the shadowchristos
2017-01-28we have space for one more.christos
2017-01-28fix size computationchristos
2017-01-16Descendchristos
2017-01-16descend and regenchristos
2017-01-13convert strcpy to a bounded copy to avoid compiler warnings, although thechristos
reclen test prevents overflow.
2017-01-13regenchristos
2016-11-10GC WOPTSCHECKEDchristos
2016-09-02Fix argument (does not compile anyway).maxv
2016-08-06The way the kernel tries to prevent a userland process from allocating pagemaxv
zero is hugely flawed. It is easy to demonstrate that one can trick UVM into chosing a NULL hint after the user_va0_disable check from uvm_map. Such a bypass allows kernel NULL pointer dereferences to be exploitable on architectures with a shared userland<->kernel VA, like amd64. Fix this by increasing the limit of the vm space made available for userland processes. This way, UVM will never chose a NULL hint, since it would be outside of the vm space. The user_va0_disable sysctl still controls this feature.
2016-08-01Apply pserialize and psref to struct ifaddr and its variantsozaki-r
This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr) MP-safe by using pserialize and psref. At this moment, pserialize_perform and psref_target_destroy are disabled because (1) we don't need them because of softnet_lock (2) they cause a deadlock because of softnet_lock. So we'll enable them when we remove softnet_lock in the future.
2016-07-07Switch the address list of intefaces to pslist(9)ozaki-r
As usual, we leave the old list to avoid breaking kvm(3) users.
2016-07-05Fix psref isn't released in a case of IFADDR_EMPTYozaki-r
2016-06-16Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUNDozaki-r
2016-06-15Protect if_byindex by pserializeozaki-r
2016-05-12Protect ifnet list with psz and psrefozaki-r
The change ensures that ifnet objects in the ifnet list aren't freed during list iterations by using pserialize(9) and psref(9). Note that the change adds a pslist(9) for ifnet but doesn't remove the original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We shouldn't use the original list in the kernel anymore.
2015-12-03Update dependencies - compat_linux32 requires compat_netbsd32_sysvipcpgoyette
2015-07-24Unused inits (harmless).maxv
Found by Brainy.
2015-03-20Zero-fill the ELF auxiliary vectors. Otherwise, on 64bit systems, themaxv
padding between a_v and a_type contains kernel garbage, therefore exposed to userland. Original report by uebayasi@
2015-03-08regenchristos
2015-03-08fix inconsistent nameschristos
2015-03-07regenchristos
2015-03-07Add systrace output filechristos
2015-03-07centralize arguments functionschristos
2014-11-26Tweak ifconf variantsozaki-r
The tweaks make the code intention clear and make further changes easy. No functional change.
2014-11-22Regen for ppoll(2)njoly
2014-11-22Add ppoll(2) for compat linux32.njoly
2014-11-17Define compat modules (but without dependencies yet).uebayasi
2014-11-09Do not uselessly include <sys/malloc.h>.maxv
2014-07-221) On 64bit systems, don't add the 32bit execsw[] to the global exec array.maxv
exec_elf32 works on 32bit systems only, and will crash 32bit binaries on 64bit systems. 2) Now that exec_elf32 is dormant, we can give the native ELF loaders the highest priority. Binaries will load faster now (system boot, compilation, etc.). With the help of njloy@. Discussed a bit on tech-kern@, no disagreement.
2014-06-21If SCARG(uap, what) = 0, copyin() will copy (size_t)-1 bytes, and it's notmaxv
a good idea; but not proven harmful. With the help of njoly@