reproducible panic in netisr

Robert Watson rwatson at FreeBSD.org
Thu Aug 6 16:33:23 UTC 2009


On Thu, 6 Aug 2009, Rick Macklem wrote:

> On Thu, 6 Aug 2009, Robert Watson wrote:
>
>> other places where we have very strong alignment requirements on 
>> i386/amd64, such as the td_ucred pointer that we check for change on system 
>> calls/traps to see if we need to refresh the thread's credential from the 
>> process credential.
>> 
> Does this imply that the nfs/krpc hack of:
> 	oldcred = td->td_ucred;
> 	td->td_ucred = "some other cred ptr"
> 	...
> 	td->td_ucred = oldcred;
>
> could be dangerous?
>
> Maybe it should be converted to code that replaces the contents instead of 
> replacing the *cred? (Variants of the above live in a bunch of places in the 
> krpc, nlm and nfs code, due to the fact that the socket functions use 
> td->td_ucred in various places.)

td->td_ucred is a thread-local variable, meaning that it will only be accessed 
and modified from the current thread.  So the above construct is fine.  Also, 
struct thread should be properly aligned. :-)

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-current mailing list