Skip to content

php-fpm is trying to read the entire / by default #25022

Closed as not planned
Closed as not planned

Description

@krustfurt

Description

The following Apparmor profile for PHP-FPM:

abi <abi/4.0>,
include <tunables/global>
/usr/sbin/php-fpm8.4 {
include <abstractions/base>
include <abstractions/php>
capability chown,
capability dac_override,
capability kill,
capability net_admin,
capability setgid,
capability setuid,
....

Resulted in this output:

apparmor="DENIED" operation="file_mmap" class="file" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/php-fpm8.4"

But I expected this output instead:

(No error)

And when I change the flag like this and restarted php-fpm,

/usr/sbin/php-fpm8.4 flags=(attach_disconnected) {

PHP-FPM tried to read entire /!

apparmor="DENIED" operation="file_mmap" class="file" profile="/usr/sbin/php-fpm8.4" name="/"

Profile:  /usr/sbin/php-fpm8.4
Path:     /
New Mode: owner rw
Severity: unknown

 [1 - owner / rw,]
(A)llow / [(D)eny] / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Audi(t) / (O)wner permissions off / Abo(r)t / (F)inish

I removed flags=(attach_disconnected) for now but why PHP-FPM tried to read /?

PHP Version

PHP 8.4.27 (NTS)

Operating System

Linux

Activity

  1. iliaal commented on Oct 29, 2026

    @iliaal
    Member

    FPM doesn't read /. Its only read-write shared mappings are anonymous mmap(MAP_SHARED|MAP_ANONYMOUS) regions (scoreboard, opcache SHM), which have no path in your namespace, hence the disconnected-path denial; attach_disconnected reports such objects as /. That's a profile rule to add, not a PHP bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions