Skip to content
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

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

Closed
wants to merge 1 commit into from

Conversation

3 participants
@benjarobin
Copy link
Contributor

commented Feb 15, 2017

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 Bugfix label Feb 15, 2017

@nikic

This comment has been minimized.

Copy link
Member

commented Feb 17, 2017

Diff without WS changes: b2e7ce4?w=1

@nikic

This comment has been minimized.

Copy link
Member

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 benjarobin:fix-getrandom branch Feb 17, 2017

nikic referenced this pull request Feb 20, 2017

algitbot pushed a commit to alpinelinux/aports that referenced this pull request Feb 23, 2017

community/php7: fix php bug #74105
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

testing/php7.1: fix php bug #74105
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

community/php7: fix php bug #74105
backport of php upstream patch
fix getrandom() call for images, deployed on kernel < 3.17
php/php-src#2385
@JohnMaguire

This comment has been minimized.

Copy link

commented Mar 16, 2017

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

@JohnMaguire

This comment has been minimized.

Copy link

commented Mar 16, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.