svn commit: r236309 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Wed May 30 13:44:43 UTC 2012


Author: kib
Date: Wed May 30 13:44:42 2012
New Revision: 236309
URL: http://svn.freebsd.org/changeset/base/236309

Log:
  Assert that TDP_NOFAULTING and TDP_NOSPEEPING thread flags do not leak
  when thread returns from a syscall to usermode.
  
  Tested by:	pho
  MFC after:	1 week

Modified:
  head/sys/kern/subr_syscall.c

Modified: head/sys/kern/subr_syscall.c
==============================================================================
--- head/sys/kern/subr_syscall.c	Wed May 30 13:33:27 2012	(r236308)
+++ head/sys/kern/subr_syscall.c	Wed May 30 13:44:42 2012	(r236309)
@@ -182,6 +182,12 @@ syscallret(struct thread *td, int error,
 	KASSERT(td->td_locks == 0,
 	    ("System call %s returning with %d locks held",
 	     syscallname(p, sa->code), td->td_locks));
+	KASSERT((td->td_pflags & TDP_NOFAULTING) == 0,
+	    ("System call %s returning with pagefaults disabled",
+	     syscallname(p, sa->code)));
+	KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0,
+	    ("System call %s returning with sleep disabled",
+	     syscallname(p, sa->code)));
 
 	/*
 	 * Handle reschedule and other end-of-syscall issues


More information about the svn-src-all mailing list