summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
Commit message (Collapse)AuthorAgeFilesLines
* MFC 302900,302902,302921,303461,304009:jhb2016-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC r302517:dchagin2016-07-172-192/+3
| | | | | | | | | | | | | Fix a copy/paste bug introduced during X86_64 Linuxulator work. FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation use READ_IMPLIES_EXEC flag, introduced in r302515. While here move common part of mmap() and mprotect() code to the files in compat/linux to reduce code dupcliation between Linuxulator's. MFC r302518, r302626: Add linux_mmap.c to the appropriate conf/files.
* Regen for r302962 (Linux personality), record mergeinfo for r320516.dchagin2016-07-175-7/+7
|
* MFC r302515:dchagin2016-07-171-1/+1
| | | | | | | | Implement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag. In Linux if this flag is set, PROT_READ implies PROT_EXEC for mmap(). Linux/i386 set this flag automatically if the binary requires executable stack. READ_IMPLIES_EXEC flag will be used in the next Linux mmap() commit.
* MFC r300359, r300360:dchagin2016-06-053-12/+12
| | | | | Correct an argument param of linux_sched_* system calls as a struct l_sched_param does not defined due to it's nature.
* MFC r298482:pfg2016-04-261-1/+1
| | | | | | Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. Requested by: dchagin
* MFC r297062:dchagin2016-03-275-7/+29
| | | | Regen for r297061 (fstatfs64 Linux syscall).
* MFC r297061;dchagin2016-03-272-2/+1
| | | | | | | Implement fstatfs64 system call. PR: 181012 Submitted by: John Wehle
* MFC r294900:delphij2016-01-271-1/+3
| | | | | | | | | | | | | Implement AT_SECURE properly. AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a boolean flag indicating whether secure mode should be enabled. 1 means that the program has changes its credentials during the execution. Being exported AT_SECURE used by glibc issetugid() call. Submitted by: imp, dchagin Security: FreeBSD-SA-16:10.linux Security: CVE-2016-1883
* MFC r293613:dchagin2016-01-161-0/+2
| | | | | Implement vsyscall hack. Prior to 2.13 glibc uses vsyscall instead of vdso. An upcoming linux_base-c6 needs it.
* o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]glebius2016-01-141-2/+2
| | | | | | | | | | | | | o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux] o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux] o Fix TCP MD5 signature denial of service. [SA-16:05.tcp] o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd] Security: FreeBSD-SA-16:01.sctp, CVE-2016-1879 Security: FreeBSD-SA-16:03.linux, CVE-2016-1880 Security: FreeBSD-SA-16:04.linux, CVE-2016-1881 Security: FreeBSD-SA-16:05.tcp, CVE-2016-1882 Security: FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677
* MFC r289055 (by mjg@):dchagin2016-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | linux: fix handling of out-of-bounds syscall attempts Due to an off by one the code would read an entry past the table, as opposed to the last entry which contains the nosys handler. This fixes my fault. MFC r289058 (by cem@): Fix missing semi-colon from r289055. MFC r289768 (by jhb@): Merge r289055 to amd64/linux32: linux: fix handling of out-of-bounds syscall attempts Due to an off by one the code would read an entry past the table, as opposed to the last entry which contains the nosys handler.
* MFC r283544:dchagin2016-01-091-9/+0
| | | | | | When I merged the lemul branch I missied kib@'s r282708 commit. This is not the final fix as I need properly cleanup thread resources before other threads suicide.
* Regen for r293592.dchagin2016-01-095-8/+20
|
* MFC r283492:dchagin2016-01-092-2/+1
| | | | Implement Linux specific syncfs() system call.
* Regen for r293588.dchagin2016-01-095-10/+69
|
* MFC r283488:dchagin2016-01-092-4/+6
| | | | Implement recvmmsg() and sendmmsg() system calls.
* MFC r283487:dchagin2016-01-091-16/+0
| | | | | Reduce duplication between MD Linux code by moving msg related struct definitions out into the compat/linux/linux_socket.h
* Regen for r293585.dchagin2016-01-095-7/+7
|
* MFC r283484:dchagin2016-01-092-2/+1
| | | | Implement epoll_pwait() system call.
* Regen for r293582.dchagin2016-01-095-8/+35
|
* MFC r283480:dchagin2016-01-092-2/+2
| | | | Add utimensat() system call.
* MFC r283474:dchagin2016-01-094-94/+17
| | | | | | | | | | | | | | | | | | | Rework signal code to allow using it by other modules, like linprocfs: 1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path. 2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals. 3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors. 4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers. PR: 197216
* MFC r283471:dchagin2016-01-092-26/+0
| | | | | | | | | | | | According to Linux man sigaltstack(3) shall return EINVAL if the ss argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE. However, in fact, Linux also allows SS_ONSTACK flag which is simply ignored. For buggy apps (at least mono) ignore other than SS_DISABLE flags as a Linux do. While here move MI part of sigaltstack code to the appropriate place.
* Regen for r293569.dchagin2016-01-094-5/+7
|
* MFC r283467:dchagin2016-01-092-1/+4
| | | | | | Call nosys in case when the incorrect syscall number is specified. Its my fault, fixed by mjg@ at r289055.
* Regen for r293567.dchagin2016-01-095-7/+34
|
* MFC r283465:dchagin2016-01-092-3/+2
| | | | | Add preliminary fallocate system call implementation to emulate posix_fallocate() function.
* Regen for r293555.dchagin2016-01-095-8/+40
|
* MFC r283451:dchagin2016-01-092-2/+2
| | | | Implement ppoll() system call.
* Regen for r293549.dchagin2016-01-095-10/+39
|
* MFC r283444:dchagin2016-01-092-4/+2
| | | | Implement eventfd system call.
* MFC r283443:dchagin2016-01-091-0/+1
| | | | | Put the correct value for the abi_nfdbits parameter of kern_select() for all supported Linuxulators.
* Regen for r293546.dchagin2016-01-095-19/+129
|
* MFC r283441:dchagin2016-01-092-9/+8
| | | | | | | | | | | Implement epoll family system calls. This is a tiny wrapper around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@.
* MFC r283437:dchagin2016-01-091-36/+1
| | | | | To avoid code duplication move open/fcntl definitions to the MI header file.
* MFC r283436:dchagin2016-01-091-6/+2
| | | | | Use the BSD_TO_LINUX_SIGNAL() wherever there is no need to check the ABI as it is known.
* MFC r283432:dchagin2016-01-091-2/+2
| | | | | | | Being exported through vdso the note.Linux section used by glibc to determine the kernel version (this saves one uname call). Temporarily disable the export of a note.Linux section until I figured out how to change the kernel version in the note.Linux on the fly.
* MFC r283431:dchagin2016-01-092-1/+27
| | | | | Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used by glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory.
* Regen for r293533.dchagin2016-01-095-10/+5
|
* MFC r283428:dchagin2016-01-091-1/+2
| | | | | | | | | Change linux faccessat syscall definition to match actual linux one. The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented within the glibc wrapper function for faccessat(). If either of these flags are specified, then the wrapper function employs fstatat() to determine access permissions.
* MFC r283421:dchagin2016-01-092-12/+8
| | | | | | | | | | | | | | | | | | | Introduce a new module linux_common.ko which is intended for the following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c
* MFC r283416:dchagin2016-01-091-0/+10
| | | | | | x86_64 Linux do not use multiplexing on ipc system calls. Move struct ipc_perm definition to the MD path as it differs for 64 and 32 bit platform.
* MFC r283411:dchagin2016-01-091-1/+0
| | | | | Remove stale comment about a signal trampoline which is moved to the shared page at r219609.
* MFC r283410:dchagin2016-01-091-4/+4
| | | | | Put linux_platform into the vdso to avoid copying it onto the stack at every exec.
* MFC r283408:dchagin2016-01-091-1/+0
| | | | Eliminate a now unused global declaration of elf_linux_sysvec.
* MFC r283407:dchagin2016-01-095-33/+256
| | | | | | | | Implement vdso - virtual dynamic shared object. Through vdso Linux exposes functions from kernel with proper DWARF CFI information so that it becomes easier to unwind through them. Using vdso is a mandatory for a thread cancelation && cleanup on a modern glibc.
* Regen for r293511.dchagin2016-01-095-8/+45
|
* MFC r283403:dchagin2016-01-092-2/+3
| | | | Implement pselect6() system call.
* Regen for r293510.dchagin2016-01-095-7/+34
|
OpenPOWER on IntegriCloud