summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Add the ability to display the default FIB number for a process to thewill2013-08-261-0/+1
| | | | | | | | | | | | | | | | | | ps(1) utility, e.g. "ps -O fib". bin/ps/keyword.c: Add the "fib" keyword and default its column name to "FIB". bin/ps/ps.1: Add "fib" as a supported keyword. sys/compat/freebsd32/freebsd32.h: sys/kern/kern_proc.c: sys/sys/user.h: Add the default fib number for a process (p->p_fibnum) to the user land accessible process data of struct kinfo_proc. Submitted by: Oliver Fromme <olli@fromme.com>, gibbs
* Give (*ext_free) an int return value allowing for very sophisticatedandre2013-08-252-7/+7
| | | | | | | | external mbuf buffer management capabilities in the future. For now only EXT_FREE_OK is defined with current legacy behavior. Sponsored by: The FreeBSD Foundation
* Regenerate after r254491.pjd2013-08-185-17/+73
|
* The cap_rights_limit(2) system calls needs a wrapper for 32bit binariespjd2013-08-182-2/+28
| | | | | | | | running under 64bit kernels as the 'rights' argument has to be split into two registers or the half of the rights will disappear. Reported by: jilles Sponsored by: The FreeBSD Foundation
* Move the PAIR32TO64() macro and the RETVAL_HI/RETVAL_LO defines to apjd2013-08-182-10/+48
| | | | | | header file for use by other .c files. Sponsored by: The FreeBSD Foundation
* Regenerate after r254481.pjd2013-08-185-22/+36
|
* Implement 32bit versions of the cap_ioctls_limit(2) and cap_ioctls_get(2)pjd2013-08-182-4/+159
| | | | | | | system calls as unsigned longs have different size on i386 and amd64. Reported by: jilles Sponsored by: The FreeBSD Foundation
* Remove a couple of unused macros.markj2013-08-171-5/+0
| | | | MFC after: 3 days
* Regenerate after r254447.pjd2013-08-175-12/+93
| | | | Sponsored by: The FreeBSD Foundation
* Make pdfork(2), pdkill(2) and pdgetpid(2) syscalls available for 32bitpjd2013-08-171-4/+4
| | | | | | binaries running under 64bit kernel. Sponsored by: The FreeBSD Foundation
* Make sendfile() a method in the struct fileops. Currently onlyglebius2013-08-151-10/+16
| | | | | | | | vnode backed file descriptors have this method implemented. Reviewed by: kib Sponsored by: Nginx, Inc. Sponsored by: Netflix
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-072-2/+2
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Regenerate.kib2013-07-215-26/+192
|
* Implement compat32 wrappers for the ktimer_* syscalls.kib2013-07-213-5/+84
| | | | | | Reported, reviewed and tested by: Petr Salinger <Petr.Salinger@seznam.cz> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Wrap kmq_notify(2) for compat32 to properly consume struct sigevent32kib2013-07-211-2/+2
| | | | | | | | argument. Reviewed and tested by: Petr Salinger <Petr.Salinger@seznam.cz> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* The freebsd32_lio_listio() compat syscall takes the struct sigevent32.kib2013-07-211-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Move the convert_sigevent32() utility function into freebsd32_misc.ckib2013-07-212-0/+28
| | | | | | | | | | | | for consumption outside the vfs_aio.c. For SIGEV_THREAD_ID and SIGEV_SIGNAL notification delivery methods, also copy in the sigev_value, since librt event pumping loop compares note generation number with the value passed through sigev_value. Tested by: Petr Salinger <Petr.Salinger@seznam.cz> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Cosmetic change, use the same union name on the left and right sideskib2013-07-211-1/+1
| | | | | | | | of the conversion. Tested by: Petr Salinger <Petr.Salinger@seznam.cz> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Regeneratekib2013-07-205-17/+29
|
* id_t is 64bit, provide the compat32 wrapper for clock_getcpuclockid2(2).kib2013-07-202-2/+17
| | | | | | Reported and tested by: Petr Salinger <Petr.Salinger@seznam.cz> PR: threads/180652 Sponsored by: The FreeBSD Foundation
* Add some missing LIBUSB IOCTL conversion codes.hselasky2013-07-142-1/+13
|
* - Move videodev headers from compat/linux to contrib/v4l (cp from vendor andnetchild2013-07-063-1548/+2
| | | | | | | | | | apply diff to compat/linux versions). - The cp implies an update of videodev2.h to the linux kernel 2.6.34.14 one. The update makes video in skype v4 work on FreeBSD. Tested by: Artyom Mirgorodskiy <artyom.mirgorodsky@gmail.com> (update of header only)
* aio_mlock() added:glebius2013-06-085-5/+35
| | | | | - Regen for r251526. - Bump __FreeBSD_version.
* Add new system call - aio_mlock(). The name speaks for itself. It allowsglebius2013-06-081-0/+2
| | | | | | | | to perform the mlock(2) operation, which can consume a lot of time, under control of aio(4). Reviewed by: kib, jilles Sponsored by: Nginx, Inc.
* Relax the vm object locking. Use a read lock.alc2013-06-051-4/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* Add a "kern.features" MIB for 32bit support under a 64bit kernel.obrien2013-05-311-0/+2
|
* Regenerate.kib2013-05-215-14/+232
|
* Fix the wait6(2) on 32bit architectures and for the compat32, by usingkib2013-05-212-4/+21
| | | | | | | | | | the right type for the argument in syscalls.master. Also fix the posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the architectures which require padding of the 64bit argument. Noted and reviewed by: jhb Pointy hat to: kib MFC after: 1 week
* Regenerate files for pipe2().jilles2013-05-015-5/+34
|
* Add pipe2() system call.jilles2013-05-011-0/+1
| | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib
* Regenerate files for accept4().jilles2013-05-015-5/+42
|
* Add accept4() system call.jilles2013-05-011-0/+4
| | | | | | | | | | | | | | | The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode.
* Regen.mdf2013-04-025-7/+7
| | | | MFC after: 1 week
* Fix return type of extattr_set_* and fix rmextattr(8) utility.mdf2013-04-021-3/+3
| | | | | | | | | extattr_set_{fd,file,link} is logically a write(2)-like operation and should return ssize_t, just like extattr_get_*. Also, the user-space utility was using an int for the return value of extattr_get_* and extattr_list_*, both of which return an ssize_t. MFC after: 1 week
* Rename do_pipe() to kern_pipe2() and declare it properly.jilles2013-03-311-5/+2
|
* Regenerate after r248599.pjd2013-03-215-5/+42
| | | | Sponsored by: The FreeBSD Foundation
* Implement chflagsat(2) system call, similar to fchmodat(2), but operates onpjd2013-03-211-0/+2
| | | | | | | file flags. Reviewed by: kib, jilles Sponsored by: The FreeBSD Foundation
* Regenerate after r248597.pjd2013-03-211-8/+8
| | | | Sponsored by: The FreeBSD Foundation
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-211-3/+4
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* Use m_get/m_gethdr instead of compat macros.glebius2013-03-151-6/+2
| | | | Sponsored by: Nginx, Inc.
* MFCattilio2013-03-089-15/+88
|\
| * Remove check for NULL prior to free(9) and m_freem(9).eadler2013-03-043-10/+5
| | | | | | | | Approved by: cperciva (mentor)
| * Regen after r247667.pjd2013-03-025-5/+79
| |
| * - Implement two new system calls:pjd2013-03-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen); which allow to bind and connect respectively to a UNIX domain socket with a path relative to the directory associated with the given file descriptor 'fd'. - Add manual pages for the new syscalls. - Make the new syscalls available for processes in capability mode sandbox. - Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on the directory descriptor for the syscalls to work. - Update audit(4) to support those two new syscalls and to handle path in sockaddr_un structure relative to the given directory descriptor. - Update procstat(1) to recognize the new capability rights. - Document the new capability rights in cap_rights_limit(2). Sponsored by: The FreeBSD Foundation Discussed with: rwatson, jilles, kib, des
* | MFCattilio2013-03-0212-32/+195
|\ \ | |/
| * Regen after r247602.pjd2013-03-025-12/+165
| |
| * Merge Capsicum overhaul:pjd2013-03-026-19/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capability is no longer separate descriptor type. Now every descriptor has set of its own capability rights. - The cap_new(2) system call is left, but it is no longer documented and should not be used in new code. - The new syscall cap_rights_limit(2) should be used instead of cap_new(2), which limits capability rights of the given descriptor without creating a new one. - The cap_getrights(2) syscall is renamed to cap_rights_get(2). - If CAP_IOCTL capability right is present we can further reduce allowed ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed ioctls can be retrived with cap_ioctls_get(2) syscall. - If CAP_FCNTL capability right is present we can further reduce fcntls that can be used with the new cap_fcntls_limit(2) syscall and retrive them with cap_fcntls_get(2). - To support ioctl and fcntl white-listing the filedesc structure was heavly modified. - The audit subsystem, kdump and procstat tools were updated to recognize new syscalls. - Capability rights were revised and eventhough I tried hard to provide backward API and ABI compatibility there are some incompatible changes that are described in detail below: CAP_CREATE old behaviour: - Allow for openat(2)+O_CREAT. - Allow for linkat(2). - Allow for symlinkat(2). CAP_CREATE new behaviour: - Allow for openat(2)+O_CREAT. Added CAP_LINKAT: - Allow for linkat(2). ABI: Reuses CAP_RMDIR bit. - Allow to be target for renameat(2). Added CAP_SYMLINKAT: - Allow for symlinkat(2). Removed CAP_DELETE. Old behaviour: - Allow for unlinkat(2) when removing non-directory object. - Allow to be source for renameat(2). Removed CAP_RMDIR. Old behaviour: - Allow for unlinkat(2) when removing directory. Added CAP_RENAMEAT: - Required for source directory for the renameat(2) syscall. Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR): - Allow for unlinkat(2) on any object. - Required if target of renameat(2) exists and will be removed by this call. Removed CAP_MAPEXEC. CAP_MMAP old behaviour: - Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and PROT_WRITE. CAP_MMAP new behaviour: - Allow for mmap(2)+PROT_NONE. Added CAP_MMAP_R: - Allow for mmap(PROT_READ). Added CAP_MMAP_W: - Allow for mmap(PROT_WRITE). Added CAP_MMAP_X: - Allow for mmap(PROT_EXEC). Added CAP_MMAP_RW: - Allow for mmap(PROT_READ | PROT_WRITE). Added CAP_MMAP_RX: - Allow for mmap(PROT_READ | PROT_EXEC). Added CAP_MMAP_WX: - Allow for mmap(PROT_WRITE | PROT_EXEC). Added CAP_MMAP_RWX: - Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). Renamed CAP_MKDIR to CAP_MKDIRAT. Renamed CAP_MKFIFO to CAP_MKFIFOAT. Renamed CAP_MKNODE to CAP_MKNODEAT. CAP_READ old behaviour: - Allow pread(2). - Disallow read(2), readv(2) (if there is no CAP_SEEK). CAP_READ new behaviour: - Allow read(2), readv(2). - Disallow pread(2) (CAP_SEEK was also required). CAP_WRITE old behaviour: - Allow pwrite(2). - Disallow write(2), writev(2) (if there is no CAP_SEEK). CAP_WRITE new behaviour: - Allow write(2), writev(2). - Disallow pwrite(2) (CAP_SEEK was also required). Added convinient defines: #define CAP_PREAD (CAP_SEEK | CAP_READ) #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) #define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) #define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) #define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL) #define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) #define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) #define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) #define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) #define CAP_SOCK_SERVER \ (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) Added defines for backward API compatibility: #define CAP_MAPEXEC CAP_MMAP_X #define CAP_DELETE CAP_UNLINKAT #define CAP_MKDIR CAP_MKDIRAT #define CAP_RMDIR CAP_UNLINKAT #define CAP_MKFIFO CAP_MKFIFOAT #define CAP_MKNOD CAP_MKNODAT #define CAP_SOCK_ALL (CAP_SOCK_CLIENT | CAP_SOCK_SERVER) Sponsored by: The FreeBSD Foundation Reviewed by: Christoph Mallon <christoph.mallon@gmx.de> Many aspects discussed with: rwatson, benl, jonathan ABI compatibility discussed with: kib
| * Fix wrong assignment.delphij2013-03-011-1/+1
| | | | | | | | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev 9568dd07a22a136e380e6c19a8ea188eb92976d5 MFC after: 2 weeks
* | Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() toattilio2013-02-201-4/+4
|/ | | | | | their "write" versions. Sponsored by: EMC / Isilon storage division
* Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.hjhb2013-01-2913-7/+175
| | | | | | | by moving bits that are MI out into headers in compat/linux. Reviewed by: Chagin Dmitry dmitry | gmail MFC after: 2 weeks
OpenPOWER on IntegriCloud