summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_4Luiz Souza2018-05-082-0/+12
|\
| * Fix multiple small kernel memory disclosures. [EN-18:05.mem]gordon2018-05-082-0/+12
| | | | | | | | | | | | | | Approved by: so Security: CVE-2018-6920 Security: CVE-2018-6921 Security: FreeBSD-EN-18:05.mem
* | Revert "Revert "MFC r319873:""Luiz Souza2018-02-231-0/+1
| | | | | | | | This reverts commit 4c9907d21517c211b27a3cf5b7a2a976623820cc.
* | Revert "MFC r319873:"Luiz Souza2018-02-211-1/+0
| | | | | | | | This reverts commit 5dad0dd804a33b8a372d49fa342b24c67b1c2fb3.
* | MFC r319873:kib2018-02-191-0/+1
|/ | | | | | | Move struct syscall_args syscall arguments parameters container into struct thread. (cherry picked from commit 985b26c6741218c134a15526fd32b736bd73fa8a)
* MFC r320353: linux_getdents, linux_readdir: fix mismatch between malloc and ↵avg2017-06-291-4/+4
| | | | | | free tags Approved by: re (gjb)
* MFC r319571:dchagin2017-06-111-1/+5
| | | | | | | | | | On success, getrandom() Linux system call returns the number of bytes that were copied to the buffer supplied by the user. PR: 219464 Submitted by: Maciej Pasternacki Reported by: Maciej Pasternacki Approved by: re (kib)
* MFC r317601:dchagin2017-06-041-1/+1
| | | | | | | Fix symlinkat() which use the newdfd argument to look up the old path, while it should use it for the new path instead. Approved by: re (kib)
* MFC 316658:avatar2017-05-152-0/+49
| | | | | | | | | | | Adding SIOCGIFNAME support in Linuxulator. This should silence the console warning associated with linux-opera: linux: pid 23492 (opera): ioctl fd=5, cmd=0x8910 ('\M^I',16) is not implemented linux: pid 23492 (opera): ioctl fd=28, cmd=0x8910 ('\M^I',16) is not implemented ... Reviewed by: kib, marcel, dchagin Tested with: linux-opera-12.16_3
* MFC r317645:dchagin2017-05-081-3/+6
| | | | | | | Fix NULL pointer dereference in futex_wake_op() in case when the same address specified for arguments uaddr and uaddr2. PR: 218987
* MFC r316426:dchagin2017-05-012-11/+27
| | | | | Use the kern_clock_nanosleep() to implement Linux clock_nanosleep() with the proper handling of the TIMER_ABSTIME flag.
* MFC r317324:dchagin2017-04-301-1/+3
| | | | Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.
* MFC r317323:dchagin2017-04-302-1/+72
| | | | | | Add Evdev ioctl handler to the Linuxulator. PR: 218627
* MFC r316776 (by cem@):dchagin2017-04-291-2/+12
| | | | | | | | | | | linux_ioctl: Refactor some v4l2 struct converters According to the C standard, it is invalid to copy beyond the end of an object, even if that object is obviously a member of a larger object (a struct, in this case). Appease the standard and Coverity by refactoring the copy in a straightforward way. No functional change.
* MFC r316289:dchagin2017-04-291-5/+1
| | | | Use kern_mincore() helper instead of abusing syscall entry.
* MFC r315957:dchagin2017-04-291-0/+14
| | | | | Implement Linux mincore() system call. This is necessary for the upcoming drm-next.
* MFC r315505:dchagin2017-04-232-0/+30
| | | | | Implement getrandom() syscall. Note. GRND_RANDOM option is not supported for now.
* MFC r315501:dchagin2017-04-151-0/+33
| | | | To reduce code duplication move socket defines to the MI path.
* MFC r316395:dchagin2017-04-151-3/+0
| | | | Remove excess tv_nsec test as this is done by linux_to_native_timespec().
* MFC r316394:dchagin2017-04-151-1/+1
| | | | The value in the tv_nsec field should be in the range 0 to 999999999.
* MFC r316393:dchagin2017-04-151-2/+1
| | | | | | As noted by bde@ negative tv_sec values are not checked for overflow, so overflow can still occur. Fix that. Also remove the extra check for tv_sec size as under COMPAT_LINUX32 it is always true.
* MFC r315498:dchagin2017-04-151-1/+1
| | | | | Check for negative nanoseconds. Linux do that in timespec_valid().
* MFC r316599:dchagin2017-04-151-2/+2
| | | | | Prevent ushort values overflow when convert new Linux 64-bit ipc struct to the old Linux ipc struct.
* MFC r314868:dchagin2017-04-151-0/+2
| | | | | Linux semop system call return EINVAL in case when the invalid nsops or semid values specified.
* MFC r314867:dchagin2017-04-151-1/+2
| | | | | Linux kernel does not export to the user space ipc_perm.mode values other than S_IRWXUGO (0777).
* MFC r314866:dchagin2017-04-152-180/+388
| | | | | | | | | | | | | Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit related struct definitions out into the MI path. Invert the native ipc structs to the Linux ipc structs convesion logic. Since 64-bit variant of ipc structs has more precision convert native ipc structs to the 64-bit Linux ipc structs and then truncate 64-bit values into the non 64-bit if needed. Unlike Linux, return EOVERFLOW if the values do not fit. Fix SYSV IPC for 64-bit Linuxulator which never sets IPC_64 bit.
* MFC r314648:dchagin2017-04-151-12/+12
| | | | Style(9).
* MFC r314647:dchagin2017-04-151-11/+2
| | | | | | | | Remove attribute __packed from some IPC struct definition since Linuxulator is x86 only. The only notable differences in algnment for an LP64 64-bit system when compared to a 32-bit system is an eight or large byte types alignment.
* MFC r314782:mmokhi2017-04-111-0/+8
| | | | | | | | Add UNIMPLEMENTED() placeholder macro for the syscalls that are not implemented in Linux kernel itself. Cleanup DUMMY() macros. Approved by: trasz
* MFC r314046:trasz2017-04-011-36/+0
| | | | | | | | | Get rid of foo_sys() in linuxulator code. It was commented out, and it would be useless anyway - there is no point in pretending to have block devices; our "block" devices are in fact character ones, and can only be accessed as such. Sponsored by: DARPA, AFRL
* MFC r314404:dchagin2017-03-301-7/+21
| | | | | Linux epoll return EEXIST on case when op is EPOLL_CTL_ADD, and the supplied file descriptor fd is already registered with this epoll instance.
* MFC r314403:dchagin2017-03-301-16/+3
| | | | | Linux epoll return ENOENT error in case when op is EPOLL_CTL_MOD or EPOLL_CTL_DEL, and fd is not registered with this epoll instance.
* MFC r314402:dchagin2017-03-301-2/+3
| | | | | | | FreeBSD does not have analgue for epoll EPOLLPRI event type. So, do not set EPOLLPRI event acidently. Also, do not set EPOLLWRNORM and EPOLLRDNORM events as epoll do not set this events.
* MFC r314344:dchagin2017-03-301-3/+3
| | | | Return EINVAL when an invalid file descriptor specified.
* MFC r314343:dchagin2017-03-301-9/+8
| | | | Unify eventfd ioctl method and use it for other similar interfaces.
* MFC r314312:dchagin2017-03-301-0/+2
| | | | | | | | | | | | Change Linux epoll_pwait syscall definition to match Linux actual one. MFC r314313: Regen for r314312 (Linux epoll_pwait). MFC r314314: Return EINVAL in case when an invalid size of signal mask specified.
* MFC r314311:dchagin2017-03-301-15/+21
| | | | Restore signal mask in epoll_pwait.
* MFC r314309:dchagin2017-03-301-1/+7
| | | | Return EINVAL when an invalid file descriptor is specified.
* MFC r314295:dchagin2017-03-304-0/+443
| | | | Implement timerfd family syscalls.
* MFC r314294:dchagin2017-03-301-22/+12
| | | | | Mostly style(9) changes, replace unused eventfd_truncate() by default invfo_truncate() method.
* MFC r314293:dchagin2017-03-303-14/+30
| | | | | Return EOVERFLOW error in case then the size of tv_sec field of struct timespec in COMPAT_LINUX32 Linuxulator's not equal to the size of native tv_sec.
* MFC r315499:dchagin2017-03-251-3/+0
| | | | Remove superflous break statment.
* MFC r315503:dchagin2017-03-251-1/+1
| | | | | | | As noted by Roel Bouwman Linux allows a large buffer size than the struct ucred size. Fix this. PR: 102956
* MFC r315278:dchagin2017-03-251-2/+2
| | | | Fix usage of the same 'i' variable in the external and nested loops.
* MFC r315510vangyzen2017-03-211-2/+2
| | | | | | | | | | | | | nanosleep: plug a kernel memory disclosure nanosleep() updates rmtp on EINVAL. In that case, kern_nanosleep() has not updated rmt, so sys_nanosleep() updates the user-space rmtp by copying garbage from its stack frame. This is not only a kernel memory disclosure, it's also not POSIX-compliant. Fix it to update rmtp only on EINTR. Security: possibly Sponsored by: Dell EMC
* MFC r313947:trasz2017-03-191-1/+16
| | | | | | | | | There are some Linux binaries that expect the system to obey the "addr" parameter to mmap(2), even if MAP_FIXED is not explicitly specified. Android ART is one example. Implement bug compatibility for this case in linuxulator. Sponsored by: DARPA, AFRL
* MFC r313281:trasz2017-03-191-14/+5
| | | | | | | Add kern_cpuset_getaffinity() and kern_cpuset_getaffinity(), and use it in compats instead of their sys_*() counterparts. Sponsored by: DARPA, AFRL
* MFC r313018:trasz2017-03-191-18/+4
| | | | | | | Add kern_pread() and kern_pwrite(), and use it in compats instead of their sys_*() counterparts. The svr4 is left unchanged. Sponsored by: DARPA, AFRL
* MFC r312987:trasz2017-03-191-19/+5
| | | | | | | Add kern_lseek() and use it instead of sys_lseek() in various compats. I didn't touch svr4/, there's no point. Sponsored by: DARPA, AFRL
* MFC r312988:trasz2017-03-191-31/+13
| | | | | | | | Add kern_listen(), kern_shutdown(), and kern_socket(), and use them instead of their sys_*() counterparts in various compats. The svr4 is left untouched, because there's no point. Sponsored by: DARPA, AFRL
OpenPOWER on IntegriCloud