diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2013-08-18 13:37:54 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2013-08-18 13:37:54 +0000 |
commit | 32536142f62f783c4d930565a334e4616ae96e0a (patch) | |
tree | 6b9ad5dcff5858311f66e4271f9bbe1c9c4f0981 /sys/compat/freebsd32/freebsd32_capability.c | |
parent | d6f6b8764762fe3371bf6e36fcfb0d8c82716393 (diff) | |
download | src-32536142f62f783c4d930565a334e4616ae96e0a.tar.gz src-32536142f62f783c4d930565a334e4616ae96e0a.zip |
The cap_rights_limit(2) system calls needs a wrapper for 32bit binaries
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
Notes
Notes:
svn path=/head/; revision=254491
Diffstat (limited to 'sys/compat/freebsd32/freebsd32_capability.c')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_capability.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_capability.c b/sys/compat/freebsd32/freebsd32_capability.c index 078d949d3798..e17c39417ffc 100644 --- a/sys/compat/freebsd32/freebsd32_capability.c +++ b/sys/compat/freebsd32/freebsd32_capability.c @@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/proc.h> #include <sys/syscallsubr.h> +#include <sys/sysproto.h> #include <security/audit/audit.h> +#include <compat/freebsd32/freebsd32_misc.h> #include <compat/freebsd32/freebsd32_proto.h> #ifdef CAPABILITIES @@ -48,6 +50,17 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_FILECAPS); int +freebsd32_cap_rights_limit(struct thread *td, + struct freebsd32_cap_rights_limit_args *uap) +{ + struct cap_rights_limit_args ap; + + ap.fd = uap->fd; + ap.rights = PAIR32TO64(uint64_t, uap->rights); + return (sys_cap_rights_limit(td, &ap)); +} + +int freebsd32_cap_ioctls_limit(struct thread *td, struct freebsd32_cap_ioctls_limit_args *uap) { @@ -135,6 +148,14 @@ out: #else /* !CAPABILITIES */ int +freebsd32_cap_rights_limit(struct thread *td, + struct freebsd32_cap_rights_limit_args *uap) +{ + + return (ENOSYS); +} + +int freebsd32_cap_ioctls_limit(struct thread *td, struct freebsd32_cap_ioctls_limit_args *uap) { |