Commit e7c1df0
committed
scsi: target: Fix SELinux error when systemd-modules loads the target module
JIRA: https://issues.redhat.com/browse/RHEL-21327
If the systemd-modules service loads the target module, the credentials of
that userspace process will be used to validate the access to the target db
directory. SELinux will prevent it, reporting an error like the following:
kernel: audit: type=1400 audit(1676301082.205:4): avc: denied { read }
for pid=1020 comm="systemd-modules" name="target" dev="dm-3"
ino=4657583 scontext=system_u:system_r:systemd_modules_load_t:s0
tcontext=system_u:object_r:targetd_etc_rw_t:s0 tclass=dir permissive=0
Fix the error by using the kernel credentials to access the db directory
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Link: https://lore.kernel.org/r/20240215143944.847184-2-mlombard@redhat.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 97a54ef)
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>1 parent 5faf715 commit e7c1df0
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3672 | 3672 | | |
3673 | 3673 | | |
3674 | 3674 | | |
| 3675 | + | |
| 3676 | + | |
3675 | 3677 | | |
3676 | 3678 | | |
3677 | 3679 | | |
| |||
3748 | 3750 | | |
3749 | 3751 | | |
3750 | 3752 | | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
3751 | 3760 | | |
| 3761 | + | |
| 3762 | + | |
3752 | 3763 | | |
3753 | 3764 | | |
3754 | 3765 | | |
3755 | 3766 | | |
| 3767 | + | |
3756 | 3768 | | |
3757 | 3769 | | |
3758 | 3770 | | |
| |||
0 commit comments