summaryrefslogtreecommitdiff
path: root/sys/compat/linux32/common
AgeCommit message (Collapse)Author
2022-12-24s/reqest/request/, s/requst/request/ and s/reuqest/request/ in comments.andvar
2021-12-02add prlimit64(2) syscall to COMPAT_LINUX and COMPAT_LINUX32ryo
2021-11-27Add pselect6(2) system call to COMPAT_LINUX32ryo
2021-11-26The changes on compat/linux/common/linux_termios.c should alsoryo
be applied to compat/linux32/common/linux_termios.c, and reduce diff. - remove duplicate fd_putfile(). This will be done after "goto out;". - catch up from compat/linux/common/linux_termios.c r1.26 TIOCSPTLCK - catch up from compat/linux/common/linux_termios.c r1.37 (TCOOFF/TCOON) of the TCXONC - catch up from compat/linux/common/linux_termios.c r1.39 FIOCLEX and FIONCLEX
2021-11-26Remove #error, fixes the build. I don't understand why this would not workchristos
on big endian. We use this construct to convert pointers everywhere else.
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-25- Add compat_linux statx(2) syscall.ryo
- The AT_EMPTY_PATH processing from the modification of sys/compat/linux/common/linux_file64.c r1.63 has been separated, and made common to linux_statat(), so that it can be used not only by linux32_sys_fstatat64() but also by other *statat() variants.
2021-11-01Use "stack_t" instead of "struct sigaltstack", as the former is thethorpej
newer standardized name. NFC.
2021-09-20Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-20Add the eventfd system calls to COMPAT_LINUX and COMPAT_LINUX32.thorpej
2021-09-19Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.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-19Remove redundant linux32_to_native_timespec() prototype.thorpej
2021-09-19Add routines to convert from linux32 to native sigevent_t.thorpej
2021-09-19G/C some unused (and unnecessary) definitions.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-07-16 Don't accept negative value.msaitoh
Reported-by: syzbot+e71a77402d6668f1868d@syzkaller.appspotmail.com
2020-06-11Counter tweaks:ad
- Don't need to count anonpages+filepages any more; clean+unknown+dirty for each kind of page can be summed to get the totals. - Track the number of free pages with a counter so that it's one less thing for the allocator to do, which opens up further options there. - Remove cpu_count_sync_one(). It has no users and doesn't save a whole lot. For the cheap option, give cpu_count_sync() a boolean parameter indicating that a cached value is okay, and rate limit the updates for cached values to hz.
2020-06-11uvm_availmem(): give it a boolean argument to specify whether a recentad
cached value will do, or if the very latest total must be fetched. It can be called thousands of times a second and fetching the totals impacts not only the calling LWP but other CPUs doing unrelated activity in the VM system.
2020-05-03Always clear FUTEX_PRIVATE_FLAG for Linux processes. NetBSD-native futexesthorpej
exist in different namespace depending on FUTEX_PRIVATE_FLAG. This appears not to be the case in Linux, and some futex users will mix private and non- private ops on the same futex object. Provide a convenience wrapper that puts this logic in one place witn a comment explaining why. While here, move the Linux futex wrapper out of its own file and plop it in linux_misc.c, which is where it lives in the linux32 module.
2020-04-29Oops, fix a silly mistake in the Linux futex syscall stubs -- we alsothorpej
copy in the timeout for FUTEX_WAIT_BITSET.
2020-04-26Add a NetBSD native futex implementation, mostly written by riastradh@.thorpej
Map the COMPAT_LINUX futex calls to the native ones.
2020-04-19- Only increment nprocs when we're creating a new process, not justthorpej
when allocating a PID. - Per above, proc_free_pid() no longer decrements nprocs. It's now done in proc_free() right after proc_free_pid(). - Ensure nprocs is accessed using atomics everywhere.
2020-03-21Deal with having to teardown sysctl entries in multiple sub-trees.pgoyette
(This used to work, but I broke it recently.)
2020-03-16Use the module subsystem's ability to process SYSCTL_SETUP() entries topgoyette
automate installation of sysctl nodes. Note that there are still a number of device and pseudo-device modules that create entries tied to individual device units, rather than to the module itself. These are not changed.
2019-12-31Rename uvm_free() -> uvm_availmem().ad
2019-12-21uvmexp.free -> uvm_free()ad
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-09-20Avoid signed integer overflow when convering linux timeval to timespeckamil
Linux accepts garbage as timeout and attempts to set it to something meaningful. Instead of checking for valid ranges of usec, just convert the type safely, regardless of what is inside it.
2019-08-23Hum, don't forget the 'pid' argument, otherwise we're not gonna go verymaxv
far.
2019-08-23Put the printf under DEBUG_LINUX.maxv
2019-08-23Add a default case, don't call sys_ioctl() with an uninitialized 'com'maxv
argument.
2019-08-23Fix info leaks in sigaltstack.maxv
2019-08-23Fix info leaks in sysinfo().maxv
2019-08-23Fix info leaks.maxv
2019-08-23Fix info leaks.maxv
2019-04-18Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stackchristos
disclosure. From Andy Nguyen, many thanks! This is the compat code part pointed out by ozaki-r@
2019-02-21for sysv ipc stat operations, explicitly copy the exported partsmrg
instead of the whole ds structure. besides triggering a recently added assert in netbsd32, this stops exposing kernel addresses. copy the mode clamping to 0777 from sem to shm and msg. while here, make sure that the compat callers to sysv_ipc clear the contents of the compat structure before setting the result members to ensure padding bytes are cleared. don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal. even if used, which seems very dodgy, they leak KVAs as well. possibly this may affect linux binaries, in particular, the comments around _shm_internal ("XXX Oh well.") may mean apps rely upon these but hopefully not -- the comments date back to rev 1.1 in 1995. the _key, _seq and _msg_cbytes members are exported as before as i found multiple consumers of these (no less than ipcs(1), and they appear to be useful for debugging and more. XXX: the naming of compat functions have too many styles. there are at least 3 different ones changed here.
2019-01-27Merge the [pgoyette-compat] branchpgoyette
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2018-08-22- Cleanup for dynamic sysctl:msaitoh
- Remove unused *_NAMES macros for sysctl. - Remove unused *_MAXID for sysctls. - Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and use them on all m68k machines.
2018-08-10Allow syscall_establish() to install new syscalls when the existingpgoyette
entry-point is either sys_nomodule or sys_nosys. Update the makesyscalls.sh script to create a const array of bits to allow syscall_disestablish() to properly restore the original entry-point. Update all the initializers of struct emul to initialize the pointer to the bit array struct emul. XXX Regen of all files created by makesyscalls.sh will come soon, XXX followed by a kernel version bump (since struct emul is being XXX modified). This commit should address PR kern/45781 and also removes the need for the work-around for that PR in file sys/arch/usermode/modules/syscallemu/syscallemu.c
2018-05-10Fix pserialize enter/exit pairs in linux_getifconf and linux32_getifconfozaki-r
Tested by using a small linux program that uses ioctl(SIOCGIFCONF). Probably fix PR kern/53259 as well.
2018-05-06Remove an element from struct emul: e_tracesigkamil
e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin compatiblity layer is gone and there are no other users. This functionality isn't used where it shall be used in the existing codebase. If we want to emulate debugging interfaces in compat layers we would need to implement that from scratch anyway. We would need to be bug compatible with other OSes too. Proposed on tech-kern@. Welcome to NetBSD 8.99.16! Sponsored by <The NetBSD Foundation>
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