expat asks for entropy the graph has - #451
Merged
Merged
Conversation
`lib/expat_config.h` is one static header shared by every target, and it
carried `#define HAVE_ARC4RANDOM_BUF 1` from a glibc configure run. Over
openkal-musl the member stopped at
xmlparse.c:977:3: error: call to undeclared function 'arc4random_buf'
musl 1.2.5 has no arc4random at all --- its `src/prng/` is the rand48 family,
and the name appears in no header. This is therefore a recipe that claims a
function for hosts that do not have it, not a gap in the C library.
THE MACRO SHORT-CIRCUITS THE WHOLE CHAIN, which is why the fallbacks below it
never ran. `generate_hash_secret_salt` reads:
#if defined(HAVE_ARC4RANDOM_BUF)
arc4random_buf(&entropy, sizeof(entropy));
#elif defined(HAVE_ARC4RANDOM)
#else
/* Try high quality providers first .. */
# elif defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
Undefined, the chain falls to `HAVE_GETRANDOM`, already defined in this same
header and provided by both musl and glibc, and then to `XML_DEV_URANDOM`. No
target loses a high-quality entropy source; the glibc hosts that were reaching
arc4random_buf reach getrandom instead.
Verified against the published stack --- openkal-linux 0.15.0, openkal-musl
0.18.0, openkal-llvm-runtime 0.13.0 --- with this checkout as a live index:
expat 2.7.1 compiles and the program links and runs, and the artefact
references no arc4random symbol.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
lib/expat_config.his one static header shared by every target, and it carried#define HAVE_ARC4RANDOM_BUF 1from a glibc configure run. Over openkal-musl the member stopped at:musl 1.2.5 has no arc4random at all — its
src/prng/is the rand48 family, and the name appears in no header. So this is a recipe claiming a function for hosts that do not have it, not a gap in the C library. (The measurement had it filed under the latter; reading musl settled it.)Why the fallbacks never ran
The macro short-circuits the whole chain:
Undefined, the chain falls to
HAVE_GETRANDOM— already defined in this same header, and provided by both musl and glibc — then toXML_DEV_URANDOM. No target loses a high-quality entropy source.Verification
Built against the published stack (openkal-linux 0.15.0, openkal-musl 0.18.0, openkal-llvm-runtime 0.13.0) with this checkout as a live index:
nm -uon the artefact shows no arc4random symbol