Bug #75817 [NEW]: Fatal in calling session_start()

From: Date: Mon, 15 Jan 2018 09:44:02 +0000
Subject: Bug #75817 [NEW]: Fatal in calling session_start()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213540@lists.php.net to get a copy of this message
From:             chensl6588 at gmail dot com
Operating system: FreeBSD-10.2-i386
PHP version:      7.2.1
Package:          Session related
Bug Type:         Bug
Bug description:Fatal in calling session_start()

Description:
------------
While PHP is running in FPM with chroot safe_mode, and the
session.save_handler is "files".

#ext/session/mod_files.c: PS_CREATE_SID_FUNC(files)
{{
    sid = php_session_create_id((void**)&data);
}}
This statement would always return NULL to sid, because of
php_random_bytes() returning FAILURE.


SOLUTION:

ext/standard/random.c: 

Line 94: #elif HAVE_DECL_ARC4RANDOM_BUF && ((defined(__FreeBSD__) ||
(defined(__OpenBSD__) && OpenBSD >= 201405) || (defined(__NetBSD__) &&
__NetBSD_Version__ >= 700000001))




Test script:
---------------
session_start();




-- 
Edit bug report at https://bugs.php.net/bug.php?id=75817&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75817&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75817&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75817&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75817&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75817&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75817&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75817&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75817&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75817&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75817&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75817&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75817&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75817&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75817&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75817&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75817&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75817&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75817&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75817&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75817&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#213540) next »