summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* MFC r305896:dchagin2016-09-241-0/+9
| | | | | | Implement BLKSSZGET ioctl for the Linuxulator. PR: 212700
* MFC r302517:dchagin2016-07-172-0/+306
| | | | | | | | | | | | | 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.
* MFC r302515:dchagin2016-07-174-6/+86
| | | | | | | | 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 r302213:dchagin2016-06-291-8/+6
| | | | | | | | | | | | | | | | Fix a bug introduced in r283433. [1] Remove unneeded sockaddr conversion before kern_recvit() call as the from argument is used to record result (the source address of the received message) only. [2] In Linux the type of msg_namelen member of struct msghdr is signed but native msg_namelen has a unsigned type (socklen_t). So use the proper storage to fetch fromlen from userspace and than check the user supplied value and return EINVAL if it is less than 0 as a Linux do. Reported by: Thomas Mueller <tmueller at sysgo dot com> [1] Tested by: Thomas Mueller <tmueller at sysgo dot com> [both] Reviewed by: kib@
* MFC r292384:bdrewery2016-06-271-2/+2
| | | | | | Fix style issues around existing SDT probes. ** Changes to sys/netinet/in_kdtrace.c and sys/netinet/in_kdtrace.h skipped.
* MFC r280130:bdrewery2016-06-272-2/+2
| | | | cred: add proc_set_cred helper
* MFC r300431:dchagin2016-06-051-4/+12
| | | | | | | | Convert proto family in both directions. The linux and native values for local and inet are identical, but for inet6 values differ. PR: 155040 Reported by: Simon Walton
* MFC r300569:dchagin2016-06-051-1/+1
| | | | | | Don't leak fp in case where fo_ioctl() returns an error. Reported by: C Turt <ecturt@gmail.com>
* MFC r300416:dchagin2016-06-051-2/+11
| | | | | | | Add a missing errno translation for SO_ERROR optname. PR: 135458 Reported by: Stefan Schmidt
* MFC r300413:dchagin2016-06-051-84/+144
| | | | | | | | | | Due to lack the priority propagation feature replace sx by mutex. WIth this commit NPTL tests are ends in 1 minute faster. MFC r300414: For future use move futex timeout code to the separate function and switch to the high resolution sbintime_t.
* MFC r300412:dchagin2016-06-051-3/+4
| | | | | Add my copyright as I rewrote most of the futex code. Minor style(9) cleanup while here.
* MFC r300411:dchagin2016-06-051-117/+109
| | | | Minor style(9) cleanup, no functional changes.
* Merge r301053:glebius2016-05-312-0/+3
| | | | | | | Fix kernel stack disclosures in the Linux and 4.3BSD compat layers. Security: SA-16:20 Security: SA-16:21
* MFC r298829pfg2016-05-145-5/+5
| | | | sys/compat/linux*: minor spelling fixes.
* MFC r295856 (by des@):dchagin2016-05-071-0/+7
| | | | | | | | | | | | | Implement /proc/$$/limits. MFC r297781 (by dchagin@): More complete implementation of /proc/self/limits. Fix the way the code accesses process limits struct - pointed out by mjg@. MFC r298318, 298319 (by cem@): Don't print uninitialized values and initialize error return before use. PR: 207386
* MFC r298482:pfg2016-04-261-3/+2
| | | | | | Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. Requested by: dchagin
* MFCR r297519, r297525 (by pfg@):dchagin2016-04-101-3/+4
| | | | Move Linux specific times tests up to guarantee the values are defined.
* MFC r297309:dchagin2016-04-031-29/+11
| | | | Whitespaces and style(9) fix. No functional changes.
* MFC r297297:dchagin2016-04-021-0/+2
| | | | When write(2) on eventfd object fails with the error EAGAIN do not return the number of bytes written.
* MFC r297296:dchagin2016-04-021-1/+18
| | | | Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.
* Revert r297303.dchagin2016-03-271-15/+1
|
* MFC r296501:dchagin2016-03-271-0/+12
| | | | | | Link the newly created process to the corresponding parent as if CLONE_PARENT is set, then the parent of the new process will be the same as that of the calling process.
* MFC r296502, r296543, r296546, r297060:dchagin2016-03-271-14/+17
| | | | | | | | | 1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer(). Assert that kern_setitimer() returns 0. Remove bogus cast of secs. Fix style(9) issues. 2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does.
* MFC r296503, r296504:dchagin2016-03-271-1/+15
| | | | Linux accept() system call return EOPNOTSUPP errno instead of EINVAL for UDP sockets.
* MFC r297063:dchagin2016-03-271-10/+28
| | | | | | | | | | | | Whitespaces, style(9) fixes. No functional changes. MFC r297070: Return EOVERFLOW in case when actual statfs values are large enough and not fit into 32 bit fileds of a Linux struct statfs. MFC r297072: Check bsd_to_linux_statfs() return value.
* MFC r297061;dchagin2016-03-271-0/+21
| | | | | | | Implement fstatfs64 system call. PR: 181012 Submitted by: John Wehle
* MFC r296557:ae2016-03-232-0/+88
| | | | | Add support for IPPROTO_IPV6 socket layer for getsockopt/setsockopt calls. Also add mapping for several options from RFC 3493 and 3542.
* 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.
* 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 r283476:dchagin2016-01-091-2/+2
| | | | Convert Linux signal number to the FreeBSD.
OpenPOWER on IntegriCloud