Messages in this thread | | | Date | Sat, 15 Jan 2005 18:51:59 -0800 | From | Matt Mackall <> | Subject | Re: short read from /dev/urandom |
| |
On Sat, Jan 15, 2005 at 02:36:56AM +0000, H. Peter Anvin wrote: > Followup to: <20050114232154.GB18479@thunk.org> > By author: "Theodore Ts'o" <tytso@mit.edu> > In newsgroup: linux.dev.kernel > > > > Good point. The fact that there are other implementations out there > > which are doing this is a convincing argument. > > > > I am still a bit concerned still that a stupidly written program that > > opens /dev/urandom (perhaps unwittingly) and tries to read a few > > hundred megabytes will become uninterruptible until the read > > completes, but I'm not sure it's worth it to but in some kludge that > > says "break if there's a signal and count > 1 megabyte --- otherwise > > we'll return soon enough". > > > > I'm very concerned about this; this is fundamentally a change to > signal delivery semantics. > > What we might want to go along with is a read smaller than PIPE_BUF > (the largest size guaranteed to be atomic when writing to a pipe, > which is another special case) should not return fractional.
What about signals to a process blocked on /dev/random (which also has no documented mention of being interruptible by signals)?
Not handling short reads is always a bug.
-- Mathematics is the supreme nostalgia of our time. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |