kernel_samsung_a53x/drivers/target
Maurizio Lombardi d2a464d012 scsi: target: Fix SELinux error when systemd-modules loads the target module
[ Upstream commit 97a54ef596c3fd24ec2b227ba8aaf2cf5415e779 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 11:32:44 +01:00
..
iscsi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loopback Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sbp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcm_fc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_alua.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_alua.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_configfs.c scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-11-19 11:32:44 +01:00
target_core_device.c scsi: target: core: Add TMF to tmr_list handling 2024-11-18 22:25:32 +01:00
target_core_fabric_configfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_fabric_lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_file.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_hba.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_iblock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_iblock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_pr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_pr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_pscsi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_pscsi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_rd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_rd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_sbc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_spc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_stat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_tmr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_tpg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_transport.c scsi: target: core: Add TMF to tmr_list handling 2024-11-18 22:25:32 +01:00
target_core_ua.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_ua.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_user.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_xcopy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
target_core_xcopy.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00