Skip to content

GIT_RAND_GETENTROPY: do not include sys/random.h #6736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2024
Merged

GIT_RAND_GETENTROPY: do not include sys/random.h #6736

merged 1 commit into from
Feb 17, 2024

Conversation

semarie
Copy link
Contributor

@semarie semarie commented Feb 12, 2024

CMakeLists.txt is looking for unistd.h (where the getentropy function is present for at least Linux and OpenBSD).

It isn't necessary to include sys/random.h (which is Linux only).

It unbreak the build on OpenBSD.

CMakeLists.txt is looking for unistd.h (where the getentropy function is present
for at least Linux and OpenBSD).

It isn't necessary to include sys/random.h (which is Linux only).

It unbreak the build on OpenBSD.
@semarie
Copy link
Contributor Author

semarie commented Feb 12, 2024

For reference, the CMakeLists.txt#L87 detection.

From getentropy(3) man page, it should be at least glibc 2.25.

@semarie
Copy link
Contributor Author

semarie commented Feb 12, 2024

The test failing seems unrelated at first look: the job compiled fine (so the include removal was accepted by the compiler), and it failed during online test (it failed several times in row).

the test seems to failed due to Syscall param socketcall.sendto(msg) points to uninitialised byte(s)

@ethomson
Copy link
Member

The test failing seems unrelated at first look: the job compiled fine (so the include removal was accepted by the compiler), and it failed during online test (it failed several times in row).

Indeed - it looks like we need to update our valgrind suppression settings — OpenSSL has some cases where it (intentionally) doesn't initialize memory and valgrind treats that as tainted, and thus our data is treated as tainted as a result as well.

Copy link
Member

@ethomson ethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants