linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
To: Pavel Machek <pavel@ucw.cz>
Cc: Bob Beck <beck@openbsd.org>, Theodore Ts'o <tytso@mit.edu>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-api@vger.kernel.org,
	linux-crypto <linux-crypto@vger.kernel.org>,
	Theo de Raadt <deraadt@cvs.openbsd.org>
Subject: Re: [PATCH -v4] random: introduce getrandom(2) system call
Date: Thu, 31 Jul 2014 10:06:37 +0200	[thread overview]
Message-ID: <1406794012.26034.14.camel@thorin> (raw)
In-Reply-To: <20140730221819.GB18189@amd.pavel.ucw.cz>

On Don, 2014-07-31 at 00:18 +0200, Pavel Machek wrote:
> On Wed 2014-07-30 16:40:52, Bernd Petrovitsch wrote:
> > On Mit, 2014-07-30 at 07:56 -0600, Bob Beck wrote:
> > > Pavel. I have bit 'ol enterprise daemon running with established file
> > > descriptors serving thousands of connections
> > > which periodically require entropy.  Now I run out of descriptors. I
> > > can't establish new connections. but I should
> > > now halt all the other ones that require entropy?  I should raise
> > > SIGKILL on my process serving these thousands
> > > of connetions?  I don't think so.
> > 
> > If that long-running daemon periodically needs something from a device,
> > one would better keep the fd for that open the whole time. Saves some
> > CPU cycles and latency too BTW.
> 
> Agreed.
> 
> On the other hand, keeping a fd open is quite tricky for a
> library. But better solution might be to make that easier.

Yes, in a (full-fledged, standalone) library seems at least tricky (also
referring to some off-list mails here: think about fork() - which could
be inside system() or popen() or similar). 

But as part of the *application* (where one has control over fork()
etc.), this should be somewhat less risky. Yes, that doesn't really help
libssl;-)

Hehe, we (Unix!) have (had) gettimeofday(), time() and similar sys-calls
since ages and no one proposed to make devices for them and get rid of
the system-calls.

> open( , O_IM_A_LIBRARY_GIVE_ME_ONE_OF_THREE_RESERVED_FDS) might be one
> solution. Actually, one reserved fd should be enough.

Well, this can also be DoSed and the proposal aims to make that
impossible (and where does this reserved count against? process-limits,
kernel-wide limit?).

	Bernd
-- 
"I dislike type abstraction if it has no real reason. And saving
on typing is not a good reason - if your typing speed is the main
issue when you're coding, you're doing something seriously wrong."
    - Linus Torvalds

  reply	other threads:[~2014-07-31  8:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 21:15 [PATCH -v4] random: introduce getrandom(2) system call Theodore Ts'o
     [not found] ` <1405718127-30042-1-git-send-email-tytso-3s7WtUTddSA@public.gmane.org>
2014-07-21 20:21   ` Till Smejkal
2014-07-21 22:23     ` Theodore Ts'o
2014-07-22 14:36 ` Rolf Eike Beer
2014-07-30 12:26 ` Pavel Machek
2014-07-30 13:56   ` Bob Beck
2014-07-30 14:40     ` Bernd Petrovitsch
2014-07-30 22:18       ` Pavel Machek
2014-07-31  8:06         ` Bernd Petrovitsch [this message]
2014-08-03 11:38           ` Pavel Machek

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=1406794012.26034.14.camel@thorin \
    --to=bernd@petrovitsch.priv.at \
    --cc=beck@openbsd.org \
    --cc=deraadt@cvs.openbsd.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).