RE: Mutexs: checking for initialization

2001-01-12 Thread John Baldwin


On 12-Jan-01 Jason Smethers wrote:
 I've got some kernel code that passes untrusted data containing mutic.
 I'd like to be able to check if the mutic have been initialized and
 return an error if they haven't. As of now I don't see a standard way
 of checking for initialization. I'd like to do it this way to abstract
 out the way things are locked, and in FreeBSD's case the mutex's
 description.
 
 I known I can do this other ways, but it'd be nice if there was a
 standard way to check for this. Just a thought, or else I'd have a
 diff =O.

Umm, well, you could write a function that walked the all_mtx list and checked
if the mutex was in that list.  However, I think that you are using the wrong
tool for your problem here. :)  I'm not sure validating mutexes is the way to
validate all the data you are receiving.

 Thanks
 - Jason

-- 

John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Mutexs: checking for initialization

2001-01-12 Thread Jason Smethers

From: "John Baldwin" [EMAIL PROTECTED]
 Umm, well, you could write a function that walked the all_mtx list
and checked
 if the mutex was in that list.  However, I think that you are using
the wrong
 tool for your problem here. :)  I'm not sure validating mutexes is
the way to
 validate all the data you are receiving.

We'll, I'm not validating ALL the data with the mutic, just the mutic
itself. Anyway, after sleep and a shower I come back and have a 'Duh'
moment. What am I trying to do and what am I doing? If I can't trust
the data being passed, how can I trust the memory it's in. Time to
change the model to a one time memory copy hit. =)

Thanks
- Jason



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message