-
Notifications
You must be signed in to change notification settings - Fork 2k
php-fpm permission denied on /proc/$id/mem #498
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
Comments
It looks like it's reading (It's definitely by design that PHP-FPM is doing this, and also definitely by design that Docker is blocking it by default.) |
@tianon good find. The reason, as I understand it that php-fpm is reading this is because it needs to get the trace details for the I'm wondering if this is working on a bare metal install of Debian. |
I imagine that this works fine on a bare metal install of Debian because it won't be applying the same security constraints by default that Docker is, and PHP-FPM will likely be able to read it's own memory file just fine. Regardless, this is really working-as-designed, so further comments/questions should likely be posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. Thanks! |
@tianon I respect that this issue may not be rooted in this docker container implementation. However, respectfully, I disagree with closing this issue until there is a resolution since it flat out does not work. |
@oojacoboo I've trying with owner permission (under CoreOS), but get another error
|
|
|
I'm still unable to reproduce an issue here -- are the systems you're testing on using AppArmor or SELinux? (I guess CoreOS is likely using SELinux, but odd that $ docker pull php:7-fpm
7-fpm: Pulling from library/php
Digest: sha256:d8ebbb9f1146af10ec9b05943f82197d99b92d6e25516d82291f6d50419f4f4b
Status: Image is up to date for php:7-fpm
$ docker run -it --rm php:7-fpm
[12-Oct-2017 21:51:56] NOTICE: fpm is running, pid 1
[12-Oct-2017 21:51:56] NOTICE: ready to handle connections See also https://travis-ci.org/docker-library/php/jobs/286978534#L2972, where Travis runs our |
@tianon PHP-FPM runs fine for most operations. As you can see in my case, it's when trying to write to the slow_log that's the issue. I'm not using AppArmor or SELinux. I'm using the pretty default |
Does the container crash, or just fail to write to the slow_log and move on?
|
Right, it only fails to write the slow_log. This is a PHP-FPM error, everything else works perfectly fine. |
@oojacoboo Just run container with |
So, it looks like the only thing that's actionable here is to add a brief note to the documentation that if (Probably with a link to https://secure.php.net/manual/en/install.fpm.configuration.php#request-slowlog-timeout for context.) |
@tianon Right. But not sure if it's only one tracing call. |
I guess my advice from #241 (comment) applies here too (and it'd probably make sense to combine the two into a single PR on the docs), namely that we need a |
(Noted that over on #241 now -- closing this in favor of that one since we need general documentation about configuring FPM anyhow, which is what that issue covers.) |
I get the following output to stderr from the php container.
Now, the slowlog would be a PHP-FPM running as
root
. However, it's my understanding that/proc
is a special kernel access dir and does not conform to standard permissions, instead obeying the UID/GID values to determine process authorization for accessing memory space. This is obviously for security purposes.I'm not really sure what the solution here is. Maybe this is even a PHP-FPM design flaw?
The text was updated successfully, but these errors were encountered: