mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: short read from /dev/urandom
Date: Sat, 15 Jan 2005 18:51:59 -0800	[thread overview]
Message-ID: <20050116025159.GB3867@waste.org> (raw)
In-Reply-To: <cs9vk8$43q$1@terminus.zytor.com>

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.

  reply	other threads:[~2005-01-16  2:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-14  4:54 Ulrich Drepper
2005-01-14  5:56 ` David Wagner
2005-01-14  6:54   ` Ulrich Drepper
2005-01-14 19:55     ` David Wagner
2005-01-14 19:10 ` Theodore Ts'o
2005-01-14 21:04   ` Ulrich Drepper
2005-01-14 23:21     ` Theodore Ts'o
2005-01-15  2:36       ` H. Peter Anvin
2005-01-16  2:51         ` Matt Mackall [this message]
2005-01-16  3:18           ` H. Peter Anvin
2005-01-15  2:34     ` H. Peter Anvin
2005-01-19 15:48     ` Pavel Machek
2005-01-16  2:44 ` Matt Mackall
2005-01-16  3:58   ` Ulrich Drepper
2005-01-16  4:58     ` Matt Mackall
2005-01-16 13:23     ` Andries Brouwer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050116025159.GB3867@waste.org \
    --to=mpm@selenic.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome