Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 1997 13:30:28 -0700
From:      Jason Thorpe <thorpej@nas.nasa.gov>
To:        dk+@ua.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Possible SERIOUS bug in open()? 
Message-ID:  <199710222030.NAA20863@lestat.nas.nasa.gov>

next in thread | raw e-mail | index | archive | help
On Wed, 22 Oct 1997 13:05:02 -0700 (PDT) 
 Dmitry Kohmanyuk <dk@dog.farm.org> wrote:

 > > How would opening for !read !write be useful?  What else could you possibly
 > > want to do?  (Yes, this is a trick question :-)
 > 
 > just for ioctl()s?

Ah, that's the trick part of the question :-)

For ioctls that change the state of the device, you absolutely want to
have it open for writing.  This is sort of obvious.

For ioctls that don't change the state of the device, you absolutely want
to have it open for reading.  I.e. if you have a device that can expose
sensitive information by ioctl, and you set the mode to 600, you won't
want random people opening it via the neat little open hole and performing
that read-only ioctl.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-6                                       Work: +1 415 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939



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