cvs commit: src/sys/kern kern_descrip.c

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jul 15 10:03:23 PDT 2004


On Wed, Jul 14, 2004 at 07:04:31PM +0000, Christian S.J. Peron wrote:
+> csjp        2004-07-14 19:04:31 UTC
+> 
+>   FreeBSD src repository
+> 
+>   Modified files:
+>     sys/kern             kern_descrip.c 
+>   Log:
+>   In addition to the real user ID check, do an explicit jail
+>   check to ensure that the caller is not prison root.
+>   
+>   The intention is to fix file descriptor creation so that
+>   prison root can not use the last remaining file descriptors.
+>   This privilege should be reserved for non-jailed root users.
[...]
+>  	fp = uma_zalloc(file_zone, M_WAITOK | M_ZERO);
+>  	sx_xlock(&filelist_lock);
+> -	if ((nfiles >= maxuserfiles && td->td_ucred->cr_ruid != 0)
+> -	   || nfiles >= maxfiles) {
+> +	if ((nfiles >= maxuserfiles && (td->td_ucred->cr_ruid != 0 ||
+> +	   jailed(td->td_ucred))) || nfiles >= maxfiles) {
+>  		if (ppsratecheck(&lastfail, &curfail, 1)) {
+>  			printf("kern.maxfiles limit exceeded by uid %i, please see tuning(7).\n",
+>  				td->td_ucred->cr_ruid);

Could we change 'td->td_ucred->cr_ruid != 0 || jailed(td->td_ucred)' to
'suser(td) != 0'?

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20040715/b8d6186f/attachment.bin


More information about the cvs-src mailing list