Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2014 08:56:58 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273458 - head/sys/kern
Message-ID:  <201410220856.s9M8uwqI029559@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Oct 22 08:56:57 2014
New Revision: 273458
URL: https://svnweb.freebsd.org/changeset/base/273458

Log:
  filedesc assert that table size is at least 3 in fdsetugidsafety
  
  Requested by: kib

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Wed Oct 22 08:54:10 2014	(r273457)
+++ head/sys/kern/kern_descrip.c	Wed Oct 22 08:56:57 2014	(r273458)
@@ -2102,6 +2102,7 @@ fdsetugidsafety(struct thread *td)
 
 	fdp = td->td_proc->p_fd;
 	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
+	MPASS(fdp->fd_nfiles >= 3);
 	for (i = 0; i <= 2; i++) {
 		fp = fdp->fd_ofiles[i].fde_file;
 		if (fp != NULL && is_unsafe(fp)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410220856.s9M8uwqI029559>