svn commit: r239587 - head/sys/kern

John Baldwin jhb at freebsd.org
Wed Sep 5 13:54:57 UTC 2012


On Wednesday, September 05, 2012 2:49:54 am Andriy Gapon wrote:
> on 22/08/2012 23:02 John Baldwin said the following:
> > Author: jhb
> > Date: Wed Aug 22 20:02:42 2012
> > New Revision: 239587
> > URL: http://svn.freebsd.org/changeset/base/239587
> > 
> > Log:
> >   Assert that system calls do not leak a pinned thread (via sched_pin()) to
> >   userland.
> > 
> > Modified:
> >   head/sys/kern/subr_syscall.c
> > 
> > Modified: head/sys/kern/subr_syscall.c
> > ==============================================================================
> > --- head/sys/kern/subr_syscall.c	Wed Aug 22 20:01:57 2012	(r239586)
> > +++ head/sys/kern/subr_syscall.c	Wed Aug 22 20:02:42 2012	(r239587)
> > @@ -188,6 +188,9 @@ syscallret(struct thread *td, int error,
> 
> I wonder if userret() would be a better place for this assert as well as the
> asserts that were already there.  userret seems to cover more cases and includes
> the syscallret case.

The one caveat of moving this to userret() is that you lose detail in the
panic message (i.e., the name of the system call that caused the problem).
However, it would be perfectly logical to move this entire block of
assertions to the bottom of userret() to catch any lock or other leaks from
ast() or traps.

-- 
John Baldwin


More information about the svn-src-all mailing list