From owner-freebsd-hackers Wed Jun 19 6:32:48 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail02.svc.cra.dublin.eircom.net (mail02.svc.cra.dublin.eircom.net [159.134.118.18]) by hub.freebsd.org (Postfix) with SMTP id C258137B401 for ; Wed, 19 Jun 2002 06:32:43 -0700 (PDT) Received: (qmail 22962 messnum 123565 invoked from network[159.134.237.78/wendell.eircom.net]); 19 Jun 2002 13:32:42 -0000 Received: from wendell.eircom.net (HELO webmail.eircom.net) (159.134.237.78) by mail02.svc.cra.dublin.eircom.net (qp 22962) with SMTP; 19 Jun 2002 13:32:42 -0000 From: "Peter Edwards" To: hackers@freebsd.org Subject: sched_setscheduler() permissions and the linux JDK 1.4 Date: Wed, 19 Jun 2002 14:32:42 +0100 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-Originating-IP: 62.17.151.61 X-Mailer: Eircom Net CRC Webmail (http://www.eircom.net/) Organization: Eircom Net (http://www.eircom.net/) Message-Id: <20020619133243.C258137B401@hub.freebsd.org> 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 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? -- Peter Edwards To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message