Re: reproducible panic in netisr

From: Julian Elischer <julian_at_elischer.org>
Date: Thu, 06 Aug 2009 08:10:21 -0700
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.)

no, creds are read-only .. you never change a cred.
You alwasy make a new one ans use it, becasue you may be shareing your 
cred with hundreds of other sibling threads or processes. (they are 
refcounted)


> 
> rick
> 
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Thu Aug 06 2009 - 13:10:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:53 UTC