From owner-svn-src-all@FreeBSD.ORG Sun Aug 18 13:37:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D7C801BC; Sun, 18 Aug 2013 13:37:55 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B63A427D2; Sun, 18 Aug 2013 13:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7IDbtlo076179; Sun, 18 Aug 2013 13:37:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7IDbtjm076169; Sun, 18 Aug 2013 13:37:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201308181337.r7IDbtjm076169@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 18 Aug 2013 13:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254491 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 13:37:56 -0000 Author: pjd Date: Sun Aug 18 13:37:54 2013 New Revision: 254491 URL: http://svnweb.freebsd.org/changeset/base/254491 Log: 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 Modified: head/sys/compat/freebsd32/freebsd32_capability.c head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/freebsd32_capability.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_capability.c Sun Aug 18 13:34:11 2013 (r254490) +++ head/sys/compat/freebsd32/freebsd32_capability.c Sun Aug 18 13:37:54 2013 (r254491) @@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #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) { Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sun Aug 18 13:34:11 2013 (r254490) +++ head/sys/compat/freebsd32/syscalls.master Sun Aug 18 13:37:54 2013 (r254491) @@ -1016,6 +1016,10 @@ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } +533 AUE_CAP_RIGHTS_LIMIT STD { \ + int freebsd32_cap_rights_limit(int fd, \ + int pad, \ + uint32_t rights1, uint32_t rights2); } #else 530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ @@ -1029,9 +1033,10 @@ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } +533 AUE_CAP_RIGHTS_LIMIT STD { \ + int freebsd32_cap_rights_limit(int fd, \ + uint32_t rights1, uint32_t rights2); } #endif -533 AUE_CAP_RIGHTS_LIMIT NOPROTO { int cap_rights_limit(int fd, \ - uint64_t rights); } 534 AUE_CAP_IOCTLS_LIMIT STD { \ int freebsd32_cap_ioctls_limit(int fd, \ const uint32_t *cmds, size_t ncmds); }