| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Approved by: so
Security: CVE-2018-6920
Security: CVE-2018-6921
Security: FreeBSD-EN-18:05.mem
|
| |
| |
| |
| | |
This reverts commit 4c9907d21517c211b27a3cf5b7a2a976623820cc.
|
| |
| |
| |
| | |
This reverts commit 5dad0dd804a33b8a372d49fa342b24c67b1c2fb3.
|
|/
|
|
|
|
|
| |
Move struct syscall_args syscall arguments parameters container into
struct thread.
(cherry picked from commit 985b26c6741218c134a15526fd32b736bd73fa8a)
|
|
|
|
|
|
| |
free tags
Approved by: re (gjb)
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Fix NULL pointer dereference in futex_wake_op() in case when the same
address specified for arguments uaddr and uaddr2.
PR: 218987
|
|
|
|
|
| |
Use the kern_clock_nanosleep() to implement Linux clock_nanosleep() with
the proper handling of the TIMER_ABSTIME flag.
|
|
|
|
| |
Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME.
|
|
|
|
|
|
| |
Add Evdev ioctl handler to the Linuxulator.
PR: 218627
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Use kern_mincore() helper instead of abusing syscall entry.
|
|
|
|
|
| |
Implement Linux mincore() system call.
This is necessary for the upcoming drm-next.
|
|
|
|
|
| |
Implement getrandom() syscall.
Note. GRND_RANDOM option is not supported for now.
|
|
|
|
| |
To reduce code duplication move socket defines to the MI path.
|
|
|
|
| |
Remove excess tv_nsec test as this is done by linux_to_native_timespec().
|
|
|
|
| |
The value in the tv_nsec field should be in the range 0 to 999999999.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Check for negative nanoseconds.
Linux do that in timespec_valid().
|
|
|
|
|
| |
Prevent ushort values overflow when convert new Linux 64-bit ipc
struct to the old Linux ipc struct.
|
|
|
|
|
| |
Linux semop system call return EINVAL in case when the invalid nsops
or semid values specified.
|
|
|
|
|
| |
Linux kernel does not export to the user space ipc_perm.mode values
other than S_IRWXUGO (0777).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Style(9).
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
Add UNIMPLEMENTED() placeholder macro for
the syscalls that are not implemented in Linux kernel itself.
Cleanup DUMMY() macros.
Approved by: trasz
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Return EINVAL when an invalid file descriptor specified.
|
|
|
|
| |
Unify eventfd ioctl method and use it for other similar interfaces.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Restore signal mask in epoll_pwait.
|
|
|
|
| |
Return EINVAL when an invalid file descriptor is specified.
|
|
|
|
| |
Implement timerfd family syscalls.
|
|
|
|
|
| |
Mostly style(9) changes, replace unused eventfd_truncate()
by default invfo_truncate() method.
|
|
|
|
|
| |
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.
|
|
|
|
| |
Remove superflous break statment.
|
|
|
|
|
|
|
| |
As noted by Roel Bouwman Linux allows a large buffer size than the
struct ucred size. Fix this.
PR: 102956
|
|
|
|
| |
Fix usage of the same 'i' variable in the external and nested loops.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Add kern_cpuset_getaffinity() and kern_cpuset_getaffinity(),
and use it in compats instead of their sys_*() counterparts.
Sponsored by: DARPA, AFRL
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|