public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30958] mkstemp always produces the same temp file if it's removed
Date: Wed, 11 Oct 2023 12:45:03 +0000	[thread overview]
Message-ID: <bug-30958-131-22eTQqgfdu@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30958-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30958

--- Comment #4 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Sterpu Mihai from comment #2)
> Questions (as a newbie in this universe):
> Are glibc and gnulib completely independent of each other?
> If yes, then can I propose a patch so the implementation uses the ASLR also
> in gnulib, like it does on glibc?
> If no and they have some sort of sync, why isn't the code synced already?

The glibc is not used in the MinGW environment, it supports only Linux and GNU
Hurd.  The tempname.c is *shared* between gnulib and glibc; but occasionally
they are kept out of sync.  The gnulib is also used on multiple projects to
provide a layer that fixes broken POSIX interfaces and adds GNU extensions.

The latest gnulib changed the way to get the initial entropy to avoid bleeding
ASLR information.  It now always issues getrandom and iff it fails for some
reason it will use the clock and a simple polynomial to get some entropy.

Also, getentropy is implemented differently depending on the system (gnulib
lib/getrandom.c).  On glibc is just a wrapper over Linux getrandom syscall,
while on Linux it tries to use either BCryptGenRandom/CryptGenRandom.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-10-11 12:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 14:13 [Bug libc/30958] New: " sterpumihai at gmail dot com
2023-10-10 19:05 ` [Bug libc/30958] " adhemerval.zanella at linaro dot org
2023-10-11  4:09 ` sterpumihai at gmail dot com
2023-10-11 10:23 ` fweimer at redhat dot com
2023-10-11 10:23 ` sam at gentoo dot org
2023-10-11 12:45 ` adhemerval.zanella at linaro dot org [this message]
2023-10-11 14:57 ` sterpumihai at gmail dot com
2023-10-11 15:09 ` schwab@linux-m68k.org
2023-10-11 15:36 ` sterpumihai at gmail dot com
2023-10-11 15:40 ` sterpumihai at gmail dot com
2023-10-11 15:47 ` sterpumihai at gmail dot com
2023-10-11 16:09 ` adhemerval.zanella at linaro dot org
2023-10-13 12:01 ` sam at gentoo dot org
2023-10-13 13:49 ` bruno at clisp dot org

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=bug-30958-131-22eTQqgfdu@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).