From owner-freebsd-hackers Fri Jan 12 10: 2:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 9C15837B400 for ; Fri, 12 Jan 2001 10:02:18 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f0CI1h133219; Fri, 12 Jan 2001 10:01:43 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <00a701c07c4c$61db61e0$edcf1f40@pdq.net> Date: Fri, 12 Jan 2001 10:02:23 -0800 (PST) From: John Baldwin To: Jason Smethers Subject: RE: Mutexs: checking for initialization Cc: hackers@FreeBSD.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 -- 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