From owner-cvs-all Wed Aug 23 19:36:12 2000 Delivered-To: cvs-all@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 4919637B423; Wed, 23 Aug 2000 19:36:06 -0700 (PDT) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.9.3/8.9.3) with SMTP id WAA26845; Wed, 23 Aug 2000 22:36:02 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Wed, 23 Aug 2000 22:36:01 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brian Feldman Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_resource.c In-Reply-To: <200008162328.QAA28755@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 16 Aug 2000, Brian Feldman wrote: > green 2000/08/16 16:28:55 PDT > > Modified files: > sys/kern kern_resource.c > Log: > Fix a couple cases where p_trespass wasn't transitioned into place. > > Make RTP_SET (rtprio) only accessible to real root, not root in jails. Errrr.... case RTP_SET: - if (pcred->pc_ucred->cr_uid && pcred->p_ruid && - pcred->pc_ucred->cr_uid != p->p_ucred->cr_uid && - pcred->p_ruid != p->p_ucred->cr_uid) + if (p_trespass(curp, p) != 0) return (EPERM); /* disallow setting rtprio in most cases if not superuser */ - if (suser(curp)) { + if (suser_xxx(NULL, curp, PRISON_ROOT) != 0) { That suser->suser_xxx change enables RTP_SET, not disables it. And the p_trespass replacement is not equivilent to what was there: p_trespass() allows suser_xxx(..., PRISON_ROOT) to override it, whereas the original check didn't. The other part of the commit (donice()) appears to do a redundant prison check, and checks suser() twice as a result. There does need to be some cleanup here, but this cleanup is not the right cleanup. I have a pile of commits sitting ready to do on this code which clean this up, and make way for the capability support. Please back out your commit. Robert N M Watson robert@fledge.watson.org http://www.watson.org/~robert/ PGP key fingerprint: AF B5 5F FF A6 4A 79 37 ED 5F 55 E9 58 04 6A B1 TIS Labs at Network Associates, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message