Bug 1622284
| Summary: | policy blocks smartd access to nvme device | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Patrick C. F. Ernzer <pcfe> |
| Component: | selinux-policy | Assignee: | Lukas Vrabec <lvrabec> |
| Status: | CLOSED WONTFIX | QA Contact: | Milos Malik <mmalik> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.5 | CC: | lvrabec, mgrepl, mmalik, orion, peljasz, plautrba, rmetrich, ssekidde, vmojzis, zpytela |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-03-14 10:25:16 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1653106 | ||
/dev/nvme0 has been adjusted to /dev/nvme0n1 sorry for posting an old log extract, here's a more recent oneAug 25 13:24:19 epyc.internal.pcfe.net smartd[38099]: smartd 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-862.11.6.el7.x86_64] (local build) Aug 25 13:24:19 epyc.internal.pcfe.net smartd[38099]: Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org Aug 25 13:24:19 epyc.internal.pcfe.net smartd[38099]: Opened configuration file /etc/smartmontools/smartd.conf Aug 25 13:24:19 epyc.internal.pcfe.net smartd[38099]: Configuration file /etc/smartmontools/smartd.conf parsed. Aug 25 13:24:19 epyc.internal.pcfe.net smartd[38099]: Device: /dev/nvme0n1, open() failed: Permission denied This issue was not selected to be included in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small number of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable. An absolute bol... well, really??? More & more boxes get NVMes every day. I really have no doubts that lots of users would love that to be in booleans. And before everybody jumped the rhel8 ship, well, it's going to be a while. Regards, L. Enforcing mode:
----
type=PROCTITLE msg=audit(10/03/2019 07:42:22.547:154) : proctitle=/usr/sbin/smartd -n -q never
type=SYSCALL msg=audit(10/03/2019 07:42:22.547:154) : arch=x86_64 syscall=lstat success=no exit=EACCES(Permission denied) a0=0x55ef652d7348 a1=0x7fffd6722cb0 a2=0x7fffd6722cb0 a3=0x7fffd6723990 items=0 ppid=1 pid=15418 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
type=AVC msg=audit(10/03/2019 07:42:22.547:154) : avc: denied { getattr } for pid=15418 comm=smartd path=/dev/nvme0 dev="devtmpfs" ino=22684 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=0
----
type=PROCTITLE msg=audit(10/03/2019 07:42:22.547:155) : proctitle=/usr/sbin/smartd -n -q never
type=SYSCALL msg=audit(10/03/2019 07:42:22.547:155) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x55ef652c8e28 a1=O_RDONLY|O_NONBLOCK a2=0x0 a3=0x55ef6479cdf0 items=0 ppid=1 pid=15418 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
type=AVC msg=audit(10/03/2019 07:42:22.547:155) : avc: denied { read } for pid=15418 comm=smartd name=nvme0 dev="devtmpfs" ino=22684 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=0
----
Permissive mode:
----
type=PROCTITLE msg=audit(10/03/2019 07:43:55.415:160) : proctitle=/usr/sbin/smartd -n -q never
type=SYSCALL msg=audit(10/03/2019 07:43:55.415:160) : arch=x86_64 syscall=lstat success=yes exit=0 a0=0x55ad5c12a348 a1=0x7ffc12b75b50 a2=0x7ffc12b75b50 a3=0x7ffc12b76830 items=0 ppid=1 pid=15521 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
type=AVC msg=audit(10/03/2019 07:43:55.415:160) : avc: denied { getattr } for pid=15521 comm=smartd path=/dev/nvme0 dev="devtmpfs" ino=22684 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=1
----
type=PROCTITLE msg=audit(10/03/2019 07:43:55.415:161) : proctitle=/usr/sbin/smartd -n -q never
type=SYSCALL msg=audit(10/03/2019 07:43:55.415:161) : arch=x86_64 syscall=open success=yes exit=3 a0=0x55ad5c11be28 a1=O_RDONLY|O_NONBLOCK a2=0x0 a3=0x55ad5bb87df0 items=0 ppid=1 pid=15521 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
type=AVC msg=audit(10/03/2019 07:43:55.415:161) : avc: denied { open } for pid=15521 comm=smartd path=/dev/nvme0 dev="devtmpfs" ino=22684 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(10/03/2019 07:43:55.415:161) : avc: denied { read } for pid=15521 comm=smartd name=nvme0 dev="devtmpfs" ino=22684 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=1
----
type=PROCTITLE msg=audit(10/03/2019 07:43:55.415:162) : proctitle=/usr/sbin/smartd -n -q never
type=SYSCALL msg=audit(10/03/2019 07:43:55.415:162) : arch=x86_64 syscall=ioctl success=no exit=ENOTTY(Inappropriate ioctl for device) a0=0x3 a1=0x4e40 a2=0x0 a3=0x55ad5bb87df0 items=0 ppid=1 pid=15521 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=smartd exe=/usr/sbin/smartd subj=system_u:system_r:fsdaemon_t:s0 key=(null)
type=AVC msg=audit(10/03/2019 07:43:55.415:162) : avc: denied { ioctl } for pid=15521 comm=smartd path=/dev/nvme0 dev="devtmpfs" ino=22684 ioctlcmd=0x4e40 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=1
----
# cat smartd_nvme.te
module smartd_nvme 1.0;
require {
type fsdaemon_t;
type nvme_device_t;
class blk_file read;
class chr_file { ioctl open read };
}
#============= fsdaemon_t ==============
allow fsdaemon_t nvme_device_t:blk_file read;
allow fsdaemon_t nvme_device_t:chr_file { ioctl open read };
|
Description of problem: when using smartd against an NVMe device, there's avc denied Version-Release number of selected component (if applicable): selinux-policy-targeted-3.13.1-192.el7_5.6.noarch How reproducible: always Steps to Reproduce: 1. configure smartd to use /dev/nvme0n1 2. start smartd Actual results: Aug 25 10:42:42 epyc.internal.pcfe.net smartd[126969]: smartd 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-862.11.6.el7.x86_64] (local build) Aug 25 10:42:42 epyc.internal.pcfe.net smartd[126969]: Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org Aug 25 10:42:42 epyc.internal.pcfe.net smartd[126969]: Opened configuration file /etc/smartmontools/smartd.conf Aug 25 10:42:42 epyc.internal.pcfe.net smartd[126969]: Configuration file /etc/smartmontools/smartd.conf parsed. Aug 25 10:42:42 epyc.internal.pcfe.net smartd[126969]: Device: /dev/nvme0, open() failed: Permission denied Expected results: smartd is allowed nvme_device_t Additional info: Currently testing if the following works. I'l know in a couple days, when smartd attempted to run both a short and a long test # cat smartd-nvme-access.te module smartd-nvme-access 1.2; require { type fsdaemon_t; type nvme_device_t; class blk_file { getattr read open ioctl }; } #============= fsdaemon_t ============== allow fsdaemon_t nvme_device_t:blk_file { getattr read open ioctl };