php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81472 Cannot support large linux major/minor device number when read /proc/self/maps
Submitted: 2021-09-24 06:14 UTC Modified: -
From: lin dot a dot yang at intel dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: master-Git-2021-09-24 (Git) OS: linux
Private report: No CVE-ID: None
 [2021-09-24 06:14 UTC] lin dot a dot yang at intel dot com
Description:
------------
Latest linux kernel already uses a large number (12 bits for major device, 20 bits for minor device). 
https://github.com/torvalds/linux/blob/master/include/linux/kdev_t.h#L10-L11

The current code only supports previous standard (5 chars) when read /proc/self/maps file during enable opcache.huge_code_pages, which means 8 bits for major and 8 bits for minor device.
https://github.com/php/php-src/blob/3cd5f2685ba87c1a5804799ef97580a5b38983b5/ext/opcache/ZendAccelerator.c#L3013

    
It will fail to find the text segment if device number is out of that range. It can be easily fixed by increasing the device string size to 9 chars when do fscanf.


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-24 06:16 UTC] lin dot a dot yang at intel dot com
The following pull request has been associated:

Patch Name: Support large device major/minor number
On GitHub:  https://github.com/php/php-src/pull/7512
Patch:      https://github.com/php/php-src/pull/7512.patch
 [2021-09-24 07:58 UTC] git@php.net
Automatic comment on behalf of linericyang (author) and nikic (committer)
Revision: https://github.com/php/php-src/commit/9ad8fadcbbb02492eddf752f1160446b572e8155
Log: Fix bug #81472: Support large device major/minor number
 [2021-09-24 07:58 UTC] git@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC