patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev,
	tglx@linutronix.de, adhemerval.zanella@linaro.org
Subject: Re: [PATCH v15 2/5] random: add vgetrandom_alloc() syscall
Date: Tue, 21 May 2024 14:32:20 +0200	[thread overview]
Message-ID: <ZkyUVOXzYg7h9OqV@zx2c4.com> (raw)
In-Reply-To: <87msoj5qth.fsf@oldenburg.str.redhat.com>

On Tue, May 21, 2024 at 01:48:10PM +0200, Florian Weimer wrote:
> * Jason A. Donenfeld:
> 
> > Libc is expected to allocate a chunk of these on first use, and then
> > dole them out to threads as they're created, allocating more when
> > needed. The returned address of the first state may be passed to
> > munmap(2) with a length of `num * size_per_each`, in order to deallocate
> > the memory.
> 
> I think “first use” actually means “processs start” here?  We don't have
> a way to report failure from arc4random and similar interfaces.

First use, actually. On failure this just falls back to slow syscall
getrandom() with identical semantics.

Adhemerval has a branch of libc where he implemented this, if you're
interested. He's in CC to send the link.

Jason

  reply	other threads:[~2024-05-21 12:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 11:18 [PATCH v15 0/5] implement getrandom() in vDSO Jason A. Donenfeld
2024-05-21 11:18 ` [PATCH v15 1/5] mm: add VM_DROPPABLE for designating always lazily freeable mappings Jason A. Donenfeld
2024-05-27 13:34   ` David Hildenbrand
2024-05-28 11:58     ` Jason A. Donenfeld
2024-05-21 11:18 ` [PATCH v15 2/5] random: add vgetrandom_alloc() syscall Jason A. Donenfeld
2024-05-21 11:48   ` Florian Weimer
2024-05-21 12:32     ` Jason A. Donenfeld [this message]
2024-05-21 11:18 ` [PATCH v15 3/5] arch: allocate vgetrandom_alloc() syscall number Jason A. Donenfeld
2024-05-22 15:36   ` Geert Uytterhoeven
2024-05-21 11:18 ` [PATCH v15 4/5] random: introduce generic vDSO getrandom() implementation Jason A. Donenfeld
2024-05-21 11:18 ` [PATCH v15 5/5] x86: vdso: Wire up getrandom() vDSO implementation Jason A. Donenfeld

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=ZkyUVOXzYg7h9OqV@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=tglx@linutronix.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).