Skip to content

Add a way to reserve shmop memory ids and prevent shmop_open (e.g. opcache's region) #9951

Open
@TysonAndre

Description

@TysonAndre

Description

shared_segments[i].common.p = shmat(shared_segments[i].shm_id, NULL, 0);

Related to #9944

Prevent accidentally or intentionally reading or writing to shared memory regions which would be used by opcache, or other extensions such as APCu

A possible approach:

  1. Add a helper method in Zend/ directory to track ids used during module initialization
  2. Make the ext/shmop extension check if those ids were already used and treat it like a native error code for https://php.net/shmop_open
  3. Add an ini setting to disable this protection, in case userland debuggers/visualizers have valid use cases for this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions