summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]glebius2016-05-312-0/+3
| | | | | | | | Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21] Security: SA-16:20 Security: SA-16:21 Approved by: so
* MFH: 285685araujo2016-02-242-2/+2
| | | | | | | | | | | Add support to the jail framework to be able to mount linsysfs(5) and linprocfs(5). PR: 207179 Requested by: thomas@gibfest.dk Reviewed by: jamie, bapt Approved by: re (gjb) Sponsored by: gandi.net Differential Revision: https://reviews.freebsd.org/D5390
* MFC 294233:dchagin2016-01-211-0/+1
| | | | | Prevent double free of control in common sendmsg path as sosend already freeing it.
* MFC 289769,289822,290143,290144:jhb2016-01-201-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename remaining linux32 symbols from linux_* to linux32_*. 289769: Rename remaining linux32 symbols such as linux_sysent[] and linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with linux64.ko. While here, add support for linux64 binaries to systrace. - Update NOPROTO entries in amd64/linux/syscalls.master to match the main table to fix systrace build. - Add a special case for union l_semun arguments to the systrace generation. - The systrace_linux32 module now only builds the systrace_linux32.ko. module on amd64. - Add a new systrace_linux module that builds on both i386 and amd64. For i386 it builds the existing systrace_linux.ko. For amd64 it builds a systrace_linux.ko for 64-bit binaries. 289822: Fix build for the KTR-enabled kernels. 290143: Fix build with DEBUG defined. 290144: Update for LINUX32 rename. The assembler didn't complain about undefined symbols but just used 0 after the rename.
* MFC r293613:dchagin2016-01-162-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-142-2/+4
| | | | | | | | | | | | | 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
* Merge from head r292743, r293627 by dchagin:glebius2016-01-111-0/+6
| | | | | | | | | | | | | ------------------------------------------------------------------------ r292743 | dchagin | 2015-12-26 01:04:47 -0800 (сб, 26 дек. 2015) | 5 lines Do not allow access to emuldata for non Linux processes. ------------------------------------------------------------------------ r293627 | dchagin | 2016-01-09 23:36:43 -0800 (сб, 09 янв. 2016) | 6 lines Unlock process lock when return error from getrobustlist call and add an forgotten dtrace probe when return the same error.
* MFC r288994 (by bdrewery):dchagin2016-01-091-28/+5
| | | | | | | | | | | | | Remove redundant RFFPWAIT/vfork(2) handling in Linux fork(2) and clone(2) wrappers. r161611 added some of the code from sys_vfork() directly into the Linux module wrappers since they use RFSTOPPED. In r232240, the RFFPWAIT handling was moved to syscallret(), thus this code in the Linux module is no longer needed as it will be called later. This also allows the Linux wrappers to benefit from the fix in r275616 for threads not getting suspended if their vforked child is stopped while they wait on them.
* MFC r287395 (by trasz):dchagin2016-01-091-1/+21
| | | | | Fixes a panic triggered by threaded Linux applications when running with RACCT/RCTL enabled.
* MFC r284626:dchagin2016-01-092-1/+5
| | | | Add EPOLLRDHUP support.
* MFC r284166 (by jkim):dchagin2016-01-091-0/+1
| | | | | | | Properly initialize flags for accept4(2) not to return spurious EINVAL. Note this fixes a Linuxulator regression introduced in r283490. PR: 200662
* MFC r284051:dchagin2016-01-091-0/+12
| | | | | Finish r283544. In exec case properly detach threads from user space before suicide.
* MFC r283544:dchagin2016-01-091-13/+5
| | | | | | 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.
* MFC r283498:dchagin2016-01-091-37/+24
| | | | | | | | | | | | | Linux nanosleep() and clock_nanosleep() system calls always writes the remaining time into the structure pointed to by rmtp unless rmtp is NULL. The value of *rmtp can then be used to call nanosleep() again and complete the specified pause if the previous call was interrupted. Note. clock_nanosleep() with an absolute time value does not write the remaining time. While here fix whitespaces and typo in SDT_PROBE.
* MFC r283497:dchagin2016-01-092-1/+18
| | | | Convert SCM_TIMESTAMP in recvmsg().
* MFC r283496:dchagin2016-01-092-3/+16
| | | | | | | The latest cp tool is trying to use the btrfs clone operation that is implemented via ioctl interface. First of all return ENOTSUP for this operation as a cp fallback to usual method in that case. Secondly, do not print out the message about unimplemented operation.
* MFC r283494:dchagin2016-01-091-2/+1
| | | | | Fix an mbuf(9) leak in sendmsg() under failure condition and remove unneeded check for failed M_WAITOK allocation.
* MFC r283492:dchagin2016-01-091-0/+41
| | | | Implement Linux specific syncfs() system call.
* MFC r283491:dchagin2016-01-091-2/+16
| | | | | Properly check tv_nsec value. The tv_nsec field can also be one of the special value UTIME_NOW or UTIME_OMIT.
* MFC r283490:dchagin2016-01-091-69/+25
| | | | | Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options remove its emulation via fcntl call from Linuxulator.
* MFC r283488:dchagin2016-01-092-42/+168
| | | | Implement recvmmsg() and sendmmsg() system calls.
* MFC r283487:dchagin2016-01-091-0/+16
| | | | | Reduce duplication between MD Linux code by moving msg related struct definitions out into the compat/linux/linux_socket.h
* MFC r283484:dchagin2016-01-091-10/+54
| | | | Implement epoll_pwait() system call.
* MFC r283483:dchagin2016-01-091-4/+10
| | | | | | Convert signal number to native for VT_SETMODE ioctl and remove strange and invalid ISSIGVALID macro. The code has not been tested right way but it was originally broken.
* MFC r283480:dchagin2016-01-092-0/+84
| | | | Add utimensat() system call.
* MFC r283478:dchagin2016-01-091-20/+3
| | | | | Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks and initialize pn_vis by well known procfs_candebug().
* MFC r283476:dchagin2016-01-091-2/+2
| | | | Convert Linux signal number to the FreeBSD.
* MFC r283475:dchagin2016-01-091-16/+14
| | | | | Convert Linux sigsets before showing. Linux kernel displays sigset always as 16x4 bit mask.
* MFC r283474:dchagin2016-01-096-104/+322
| | | | | | | | | | | | | | | | | | | 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 r283473:dchagin2016-01-091-0/+50
| | | | Add support for /proc/<pid>/auxv.
* MFC r283472:dchagin2016-01-091-4/+12
| | | | Add vdso and stack names to the /proc/self/maps.
* MFC r283471:dchagin2016-01-092-0/+28
| | | | | | | | | | | | 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.
* MFC r283470:dchagin2016-01-092-2/+6
| | | | Add EPOLLERR flag handling to epoll.
* MFC r283465:dchagin2016-01-091-0/+15
| | | | | Add preliminary fallocate system call implementation to emulate posix_fallocate() function.
* MFC r283464:dchagin2016-01-093-23/+5
| | | | Delete the duplicate of linux_to_native_clockid() function.
* MFC r283463:dchagin2016-01-094-48/+54
| | | | | Do not use struct l_timespec without conversion. While here move args->timeout handling before acquiring the futex key at FUTEX_WAIT path.
* MFC r283462:dchagin2016-01-091-0/+16
| | | | Add prototypes for static futex functions.
* MFC r283461:dchagin2016-01-091-8/+3
| | | | | | As for now our tmpfs is no longer being considered "highly experimental" remove /dev/shm magic commited in r218497 and convert tmpfs type to an expected magic number.
* MFC r283460:dchagin2016-01-092-23/+46
| | | | Print out unsupported futex operation message only once for the process.
* MFC r283459:dchagin2016-01-092-17/+205
| | | | Add some clock mappings used in glibc 2.20.
* MFC r283456:dchagin2016-01-092-7/+10
| | | | Improve ktr(9) records in thread managment code.
* MFC r283455:dchagin2016-01-091-8/+11
| | | | Use local struct proc * varable instead of dereferencing td->td_proc.
* MFC r283454:dchagin2016-01-091-4/+5
| | | | | | Avoid unnecessary em zeroing in non-exec path as it already zeroed by malloc with M_ZERO flag and move zeroing to the proper place in exec path.
* MFC r283453:dchagin2016-01-091-1/+1
| | | | Remove the unnecessary cast.
* MFC r283451:dchagin2016-01-091-0/+53
| | | | Implement ppoll() system call.
* MFC r283450:dchagin2016-01-091-1/+0
| | | | | td_sigmask of a newly created thread copied from td. Remove excess initialization of td_sigmask.
* MFC r283449:dchagin2016-01-091-1/+1
| | | | Update Linux compat revision to 32.
* MFC r283444:dchagin2016-01-092-0/+332
| | | | Implement eventfd system call.
* MFC r283443:dchagin2016-01-092-2/+5
| | | | | Put the correct value for the abi_nfdbits parameter of kern_select() for all supported Linuxulators.
* MFC r283441:dchagin2016-01-096-2/+596
| | | | | | | | | | | 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@.
OpenPOWER on IntegriCloud