Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2001 10:02:23 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jason Smethers <jsmethers@pdq.net>
Cc:        hackers@FreeBSD.org
Subject:   RE: Mutexs: checking for initialization
Message-ID:  <XFMail.010112100223.jhb@FreeBSD.org>
In-Reply-To: <00a701c07c4c$61db61e0$edcf1f40@pdq.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010112100223.jhb>