Bug 2177254
| Summary: | systemd's SIGPIPE masking is not inherited by services | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jonathan Davies <jonathan.davies> | |
| Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | |
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 8.7 | CC: | levon, lvrabec, mmalik | |
| Target Milestone: | rc | Keywords: | AutoVerified, Triaged | |
| Target Release: | 8.9 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | selinux-policy-3.14.3-120.el8 | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2186233 (view as bug list) | Environment: | ||
| Last Closed: | 2023-11-14 15:47:46 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: | 2186233 | |||
|
Description
Jonathan Davies
2023-03-10 15:40:23 UTC
After removing the dontaudit rules (semodule -DB) from active policy, a SELinux denial appears with each "systemctl start show-signals.service" command.
Caught in enforcing mode:
----
type=PROCTITLE msg=audit(03/20/2023 10:31:32.593:313) : proctitle=/usr/libexec/show-signals
type=PATH msg=audit(03/20/2023 10:31:32.593:313) : item=1 name=/lib64/ld-linux-x86-64.so.2 inode=12666 dev=fd:01 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ld_so_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(03/20/2023 10:31:32.593:313) : item=0 name=/usr/libexec/show-signals inode=1251250 dev=fd:01 mode=file,755 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:bin_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(03/20/2023 10:31:32.593:313) : cwd=/
type=EXECVE msg=audit(03/20/2023 10:31:32.593:313) : argc=1 a0=/usr/libexec/show-signals
type=SYSCALL msg=audit(03/20/2023 10:31:32.593:313) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x5627ac432240 a1=0x5627ac537e20 a2=0x5627ac60b220 a3=0x7 items=2 ppid=1 pid=5529 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=show-signals exe=/usr/libexec/show-signals subj=system_u:system_r:unconfined_service_t:s0 key=(null)
type=AVC msg=audit(03/20/2023 10:31:32.593:313) : avc: denied { siginh } for pid=5529 comm=show-signals scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=process permissive=0
----
Caught in permissive mode:
----
type=PROCTITLE msg=audit(03/20/2023 10:32:24.349:318) : proctitle=/usr/libexec/show-signals
type=PATH msg=audit(03/20/2023 10:32:24.349:318) : item=1 name=/lib64/ld-linux-x86-64.so.2 inode=12666 dev=fd:01 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ld_so_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(03/20/2023 10:32:24.349:318) : item=0 name=/usr/libexec/show-signals inode=1251250 dev=fd:01 mode=file,755 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:bin_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(03/20/2023 10:32:24.349:318) : cwd=/
type=EXECVE msg=audit(03/20/2023 10:32:24.349:318) : argc=1 a0=/usr/libexec/show-signals
type=SYSCALL msg=audit(03/20/2023 10:32:24.349:318) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x5627ac410720 a1=0x5627ac43bc50 a2=0x5627ac5871f0 a3=0x7 items=2 ppid=1 pid=5537 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=show-signals exe=/usr/libexec/show-signals subj=system_u:system_r:unconfined_service_t:s0 key=(null)
type=AVC msg=audit(03/20/2023 10:32:24.349:318) : avc: denied { siginh } for pid=5537 comm=show-signals scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=process permissive=1
----
# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33 # cat testpolicy.cil ( allow init_t unconfined_service_t ( process ( siginh ))) # semodule -i testpolicy.cil # semodule -lfull | grep test 400 testpolicy cil # systemctl start show-signals.service # systemctl status show-signals.service ● show-signals.service Loaded: loaded (/etc/systemd/system/show-signals.service; static; vendor preset: disabled) Active: inactive (dead) Mar 20 10:43:35 removed systemd[1]: Starting show-signals.service... Mar 20 10:43:35 removed show-signals[5599]: SigIgn: 0000000000001000 Mar 20 10:43:35 removed systemd[1]: show-signals.service: Succeeded. Mar 20 10:43:35 removed systemd[1]: Started show-signals.service. # I believe that the testpolicy module fixes the issue described in comment#0. The same issue is reproducible on RHEL-9.2. The permissions is allowed for 2 attributes, but unconfined_service_t is not a part of any of them:
# sesearch -A -s init_t -c process -p siginh
allow init_t daemon:process siginh;
allow init_t systemprocess:process { dyntransition siginh };
Jonathan, Thank you for the detailed analysis. A fix should be a part of the next build. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:7091 |