Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/gen



    Date:        Sun, 2 Mar 2025 22:46:24 +0000
    From:        "Taylor R Campbell" <riastradh%netbsd.org@localhost>
    Message-ID:  <20250302224624.1A707FBE1%cvs.NetBSD.org@localhost>

  | Log Message:
  | libc: New __libc_atfork.
  |
  | This uses caller-provided storage for the callback queues.
  |
  | Use it in arc4random(3) in order to avoid possible failure modes.

This is the wrong solution, it exposes the _atfork data struct outside
pthread_atfork.c which will make it essentially impossible to ever alter
the internals of that interface.

arc4random() should simply cope with pthread_atfork() failing, which its
interface spec says it is entitled to do, and which all other callers need
to deal with.

I do agree with PR lib/59117 that abort() is not a suitable "deal with"
though, but there are other ways (slower perhaps) of generating pseudo-random
bit strings (of suitable quality) that do not require the services of
pthread_atfork().   We should simply do that.

kre



Home | Main Index | Thread Index | Old Index