summaryrefslogtreecommitdiffstats
path: root/sys/compat
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
* | Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_4Luiz Souza2018-05-081-0/+1
|\ \ | |/
| * Fix multiple small kernel memory disclosures. [EN-18:04.mem]gordon2018-04-041-0/+1
| | | | | | | | | | | | | | Reported by: Ilja van Sprundel Approved by: so Security: CVE-2018-6919 Security: FreeBSD-EN-18:04.mem
* | Revert "Revert "MFC r319873:""Luiz Souza2018-02-232-1/+2
| | | | | | | | This reverts commit 4c9907d21517c211b27a3cf5b7a2a976623820cc.
* | Revert "MFC r319873:"Luiz Souza2018-02-212-2/+1
| | | | | | | | This reverts commit 5dad0dd804a33b8a372d49fa342b24c67b1c2fb3.
* | MFC r319873:kib2018-02-192-1/+2
|/ | | | | | | Move struct syscall_args syscall arguments parameters container into struct thread. (cherry picked from commit 985b26c6741218c134a15526fd32b736bd73fa8a)
* Properly bzero kldstat structure to prevent information leak. [SA-17:10]gordon2017-11-151-13/+18
| | | | | | Approved by: so Security: FreeBSD-SA-17:10.kldstat Security: CVE-2017-1088
* MFS r320605, r320610: MFC r303052, r309017 (by alc):markj2017-07-051-1/+1
| | | | | | | Omit v_cache_count when computing the number of free pages, since its value is always 0. Approved by: re (gjb, kib)
* 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 r318765:allanjude2017-06-112-4/+4
| | | | | | Allow cpuset_{get,set}affinity in capabilities mode Approved by: re (marius)
* MFC r318677:glebius2017-06-082-11/+19
| | | | | | | | | Fix regression in ndis(4) after r286410. This adds a bunch of checks for whether this is a Ethernet or 802.11 device and does proper dereferencing. PR: 213237 Submitted by: <ota j.email.ne.jp> Approved by: re (marius)
* 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 r317845-r317846brooks2017-05-127-11/+44
| | | | | | | | | | | | | | | | | | | | | | r317845: Provide a freebsd32 implementation of sigqueue() The previous misuse of sys_sigqueue() was sending random register or stack garbage to 64-bit targets. The freebsd32 implementation preserves the sival_int member of value when signaling a 64-bit process. Document the mixed ABI implementation of union sigval and the incompability of sival_ptr with pointer integrity schemes. Reviewed by: kib, wblock Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10605 r317846: Regen post r317845. MFC with: r317845 Sponsored by: DARPA, AFRL
* MFC 313564:jhb2017-05-1016-16/+0
| | | | | | | | | | | | | Drop the "created from" line from files generated by makesyscalls.sh. This information is less useful when the generated files are included in source control along with the source. If needed it can be reconstructed from the $FreeBSD$ tag in the generated file. Removing this information from the generated output permits committing the generated files along with the change to the system call master list without having inconsistent metadata in the generated files. Regenerate the affected files along with the MFC.
* 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 r317148:markj2017-05-031-9/+27
| | | | Drop Giant before sleeping in linux_wait_for_{timeout_,}common().
* 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 r315526vangyzen2017-05-017-9/+77
| | | | | | | | | | | | | | | | | | | | | | Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC
* 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 r315506:dchagin2017-04-231-3/+64
| | | | | Glibc get_nprocs() and get_nprocs_conf() uses the sysfs cpu infrastructure to get number of processors. Implement /sys/devices/system/cpu/.
* 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
* Bring kernel space CloudABI code in sync with HEAD.ed2017-04-0624-349/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r312353, r312354 and r312355: Sync in the latest CloudABI generated source files. Languages like C++17 and Go provide direct support for slice types: pointer/length pairs. The CloudABI generator now has more complete for this, meaning that for the C binding, pointer/length pairs now use an automatic naming scheme of ${name} and ${name}_len. Apart from this change and some reformatting, the ABI definitions are identical. Binary compatibility is preserved entirely. MFC r315700: Make file descriptor passing work for CloudABI's sendmsg(). Reduce the potential amount of code duplication between cloudabi32 and cloudabi64 by creating a cloudabi_sock_recv() utility function. The cloudabi32 and cloudabi64 modules will then only contain code to convert the iovecs to the native pointer size. In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in an mbuf and pass that on to kern_sendit(). MFC r315736: Make file descriptor passing for CloudABI's recvmsg() work. Similar to the change for sendmsg(), create a pointer size independent implementation of recvmsg() and let cloudabi32 and cloudabi64 call into it. In case userspace requests one or more file descriptors, call kern_recvit() in such a way that we get the control message headers in an mbuf. Iterate over all of the headers and copy the file descriptors to userspace.
* 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 r315892:ed2017-03-311-0/+1
| | | | | | | | | | | Include <sys/systm.h> to obtain the memcpy() prototype. I got a report of this source file not building on Raspberry Pi. It's interesting that this only fails for that target and not for others. Again, that's no reason not to include the right headers. PR: 217969 Reported by: Johannes Jost Meixner
* 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.
OpenPOWER on IntegriCloud