Skip to content

If getrandom syscall is unavailable (ENOSYS), try to fallback on /dev/urandom #2385

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

Closed
wants to merge 1 commit into from

Conversation

benjarobin
Copy link
Contributor

getrandom() was introduced in version 3.17 of the Linux kernel.
The php package may be deployed on 3.10 kernel, try to be robust and fallback if we failed to use getrandom()

The "faulty" commit is 14c72cc

@nikic nikic added the Bug label Feb 15, 2017
@nikic
Copy link
Member

nikic commented Feb 17, 2017

Diff without WS changes: b2e7ce4?w=1

@nikic
Copy link
Member

nikic commented Feb 17, 2017

Merged via 5135828, thanks! I've changed the read_bytes = 0 assignment into an assertions, as we should never be getting an ENOSYS return value after the syscall already succeeding once.

The control flow in this function is becoming complicated, should probably be split up.

@nikic nikic closed this Feb 17, 2017
@benjarobin benjarobin deleted the fix-getrandom branch February 17, 2017 19:04
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Feb 23, 2017
backport of php upstream patch
fix getrandom() call for images, deployed on kernel < 3.17
php/php-src#2385
algitbot pushed a commit to alpinelinux/aports that referenced this pull request Feb 23, 2017
backport of php upstream patch
fix getrandom() call for images, deployed on kernel < 3.17
php/php-src#2385
vakartel added a commit to vakartel/aports that referenced this pull request Feb 23, 2017
backport of php upstream patch
fix getrandom() call for images, deployed on kernel < 3.17
php/php-src#2385
@johnmaguire
Copy link

👍 Confirmed this fixed a bug for us on 7.1.2 -> 7.1.3.

@johnmaguire
Copy link

Specifically, session_start() was failing to create a session ID.

glensc pushed a commit to glensc/php-alpine that referenced this pull request Nov 10, 2019
backport of php upstream patch
fix getrandom() call for images, deployed on kernel < 3.17
php/php-src#2385
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.

3 participants