From owner-freebsd-hackers Wed Jun 19 7:42:18 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from ns0.seaman.net (ns0.seaman.net [168.215.64.186]) by hub.freebsd.org (Postfix) with ESMTP id 9DEA837B40D for ; Wed, 19 Jun 2002 07:41:49 -0700 (PDT) Received: from tbird.internal.seaman.net (tbird [192.168.10.12]) by ns0.seaman.net (8.12.3/8.12.3) with ESMTP id g5JEfkeR082525; Wed, 19 Jun 2002 09:41:46 -0500 (CDT) (envelope-from dick@seaman.org) Received: (from dick@localhost) by tbird.internal.seaman.net (8.11.6/8.11.6) id g5JEfka22969; Wed, 19 Jun 2002 09:41:46 -0500 Date: Wed, 19 Jun 2002 09:41:45 -0500 From: "Richard Seaman, Jr." To: Peter Edwards Cc: hackers@FreeBSD.ORG Subject: Re: sched_setscheduler() permissions and the linux JDK 1.4 Message-ID: <20020619094145.H20472@seaman.org> Mail-Followup-To: "Richard Seaman, Jr." , Peter Edwards , hackers@FreeBSD.ORG References: <20020619133243.C258137B401@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020619133243.C258137B401@hub.freebsd.org>; from pmedwards@eircom.net on Wed, Jun 19, 2002 at 02:32:42PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jun 19, 2002 at 02:32:42PM +0100, Peter Edwards wrote: > > Hi, > A couple of people have noted that the linux JDK 1.4 doesn't work for a > non-root user (on -STABLE). This is caused by sched_getscheduler() (in > sys/posix4/p1003_1b.c) failing for non-root users: by hacking > p31b_proc() to have a "read/write" flag, and a more lenient variant of > CAN_AFFECT() for read operations, my JDK works fine: but I don't feel > comfortable posting patches without understanding the security > ramifications more clearly > > The manpage for sched_getscheduler() doesn't document the permissions > very well, other than to defer to POSIX 1003.1b (which I don't have a > copy of, and SUSv2 is less than forthcoming) > > I would at least have thought that any process should at least be able > to get it's own scheduling parameter, and would have thought that this > was _not_ a "write-style" operation. Am I right? > > I was also wondering if it should be allowable for a non-root process to > set their scheduling parameters: I suppose this might lead to users > creating processes that could starve system processes. Should this > indeed be forbidden? (There's a #if 0'ed out version of CAN_AFFECT which > is much less paranoid, but there's no decent comment to describe why its > even there.) Can anyone shed (or even sched :-)) light on why CAN_AFFECT > is defined as it is? sched_setscheduler/sched_getscheduler are broken, permission wise, in both stable and current. In stable, permissions are too unreasonably restrictive, and in current too unreasonably loose. However, the sched_XXXX functions are mostly broken anyway. -- Richard Seaman, Jr. email: dick@seaman.org 5182 N. Maple Lane phone: 262-367-5450 Nashotah WI 53058 fax: 262-367-5852 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message