Date: Wed, 19 Jun 2002 13:13:42 -0500 From: "Richard Seaman, Jr." <dick@seaman.org> To: Peter Edwards <pmedwards@eircom.net> Cc: "Richard Seaman, Jr." <dick@seaman.org>, hackers@FreeBSD.ORG Subject: Re: sched_setscheduler() permissions and the linux JDK 1.4 Message-ID: <20020619131342.I20472@seaman.org> In-Reply-To: <20020619171916.586D537B414@hub.freebsd.org>; from pmedwards@eircom.net on Wed, Jun 19, 2002 at 06:19:15PM %2B0100 References: <20020619171916.586D537B414@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--+HP7ph2BbKc20aGI
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
On Wed, Jun 19, 2002 at 06:19:15PM +0100, Peter Edwards wrote:
> "Richard Seaman, Jr." <dick@seaman.org> wrote:
>
> > 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.
>
> Can you either describe what would be acceptable, or point me to
> somewhere that does? (Without having to fork out €BIGNUM to a standards
> body.)
>
> If I can get a decent description, I'm sure I can come up with something
> that comes closer to the standard, and doesnt produce as many unpleasant
> surprises for linux apps.
I'm not aware of any standard for permissions. But, the permissions in
rtprio(2) are probably right for sched_get/setscheduler and sched_get/setparam.
I have a patch for the permissions in current, but this is just a temporary
hack because there are deeper issues. I've attached it.
> > However, the sched_XXXX functions are mostly broken anyway.
>
> In what way? Is there something broken in their local implementation,
> a lack of semantically adequate mappings to the FreeBSD scheduler, or
> a general lack of functionality in the BSD rtprio stuff it maps to?
All the above. Its been on my "todo" list for quite a while to
try to describe and fix the brokenness. The list is too long for
a simple message. And, there are different issues in current vs.
stable.
--
Richard Seaman, Jr. email: dick@seaman.org
5182 N. Maple Lane phone: 262-367-5450
Nashotah WI 53058 fax: 262-367-5852
--+HP7ph2BbKc20aGI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
Index: p1003_1b.c
===================================================================
RCS file: /home/ncvs/src/sys/posix4/p1003_1b.c,v
retrieving revision 1.19
diff -u -r1.19 p1003_1b.c
--- p1003_1b.c 19 May 2002 00:14:49 -0000 1.19
+++ p1003_1b.c 2 Jun 2002 18:26:53 -0000
@@ -201,6 +201,10 @@
targettd = td;
PROC_LOCK(targetp);
} else {
+ if (suser(td) != 0) {
+ e = EPERM;
+ goto done2;
+ }
targetp = pfind(uap->pid);
if (targetp == NULL) {
e = ESRCH;
@@ -210,6 +214,8 @@
}
e = p_cansched(td, targetp);
+ if (e == 0 && uap->policy != SCHED_OTHER && suser(td) != 0)
+ e = EPERM;
PROC_UNLOCK(targetp);
if (e == 0) {
e = ksched_setscheduler(&td->td_retval[0], ksched, targettd,
--+HP7ph2BbKc20aGI--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020619131342.I20472>
