SELinux «anon_hugepage» Ошибка разрешения PHP-FPM

Пожалуйста, объясните причину следующей ошибки и почему "anon_hugepage" отсутствует в моем списке файлов.


] SELinux запрещает / usr / sbin / php-fpm доступ на запись к файлу / anon_hugepage (удален).

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/anon_hugepage (deleted) default label should be etc_runtime_t.
Then you can run restorecon.
Do \# /sbin/restorecon -v /anon_hugepage (deleted)

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that php-fpm should be allowed write access on the anon_hugepage (deleted) file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do allow this access for now by executing:

\# grep php-fpm /var/log/audit/audit.log | audit2allow -M mypol

\# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:hugetlbfs_t:s0
Target Objects                /anon_hugepage (deleted) [ file ]
Source                        php-fpm
Source Path                   /usr/sbin/php-fpm
Port                          <Unknown>
Host                          localhost
Source RPM Packages           php70w-fpm-7.0.11-1.w7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-60.el7_2.9.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     instance-1
Platform                      Linux instance-1 3.10.0-327.36.1.el7.x86_64 #1 SMP
                              Sun Sep 18 13:04:29 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-10-07 08:46:26 UTC
Last Seen                     2016-10-07 08:46:26 UTC
Local ID                      1711a7c8-1f3d-4dda-be96-69f7553186d4

Raw Audit Messages
type=AVC msg=audit(1475829986.9:445): avc:  denied  { write } for  pid=1360 comm="php-fpm" path=2F616E6F6E5F6875676570616765202864656C6574656429 dev="hugetlbfs" ino=18206 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=file


type=SYSCALL msg=audit(1475829986.9:445): arch=x86_64 syscall=mmap success=no exit=EACCES a0=0 a1=8000000 a2=3 a3=40021 items=0 ppid=1 pid=1360 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: php-fpm,httpd_t,hugetlbfs_t,file,write

****

Я безуспешно пытался выполнить следующее:

touch /anon_hugepage
semanage fcontext -a -t etc_runtime_t /anon_hugepage
restorecon -v /anon_hugepage
0
задан 7 October 2016 в 13:59
1 ответ

Мне кажется, что файл anon_hugepage отсутствует, т.к. он показывает "deleted". Также в сообщении говорится об изменении времени исполнения и выполнении:

/sbin/restorecon -v /anon_hugepage

После php должен иметь доступ к файлу с включенным SELinux. Также убедитесь, что файл находится там и имеет правильные права и собственность.

.
0
ответ дан 5 December 2019 в 09:28

Теги

Похожие вопросы