From owner-cvs-src Mon Mar 24 22:13:41 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 400DC37B401; Mon, 24 Mar 2003 22:13:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C693E43F75; Mon, 24 Mar 2003 22:13:35 -0800 (PST) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h2P6DZ0U011307; Mon, 24 Mar 2003 22:13:35 -0800 (PST) (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h2P6DZDB011306; Mon, 24 Mar 2003 22:13:35 -0800 (PST) Message-Id: <200303250613.h2P6DZDB011306@repoman.freebsd.org> From: Robert Watson Date: Mon, 24 Mar 2003 22:13:35 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/posix4 p1003_1b.c X-FreeBSD-CVS-Branch: RELENG_4 X-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG rwatson 2003/03/24 22:13:35 PST FreeBSD src repository Modified files: (Branch: RELENG_4) sys/posix4 p1003_1b.c Log: When the p1003_1b support for monitoring with and interfering with the system scheduler was committed, access to these facilities was limited to the root user (for unclear reasons, perhaps lack of understanding about the potential impact of the interfacs on system operation, or due to bugs). However, the JDK requires the ability to monitor scheduler parameters and selection for linux-threaded processes; a return of EPERM causes some applications to fail as a result (in particular, the JDK). In 5.x-CURRENT, we've replaced the access control with centralized access control primitives, giving these interfaces controls similar to those applied for rtprio(), setpriority(), etc, resulting in uniform enforcement. In order to enable proper JDK operation for 4.8-RELEASE, work around the lack of proper access control by permitting the use of two system calls: sched_getparam() and sched_getscheduler(), for non-root processes when the call is made on the current process (either using a 0 pid argument, or curproc->p_pid). While we're here, fix a bug that caused the result of the call to be returned in the target process, not in the subject process (ouch!), but that previously only affected root-owned processes. These fixes are deemed to be the lowest impact approachin the release; a backport of the 5.x-CURRENT access control primitives might also be appropriate in a non-release scenario. This fix doesn't permit the calls to succeed on other linuxthreads in the same linuxthread process, but despite those failures the JDK appears to operate properly, so we've opted not to broaden the scope to permit the p->p_leader == targetp->p_leader case at this point. The "wrong process" return value may apply to other system calls due to overloading of the subject process pointer with the target process, but doesn't currently affect non-root processes (and is fairly uncommon as usually processes are interested in frobbing their own scheduler details, not other processes, hence it not really showing up before). This should be fixed in the post 4.8-RELEASE time frame. These bugs should not be present in 5.x due to process-locking and security-related changes made in that branch well prior to 5.0-RELEASE. Submitted by: mbr (collaborative) Approved by: re (murray) Revision Changes Path 1.5.2.2 +21 -10 src/sys/posix4/p1003_1b.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-src" in the body of the message