android_kernel_xiaomi_sm8350/drivers/target
Maurizio Lombardi a66018780c 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-05-17 11:43:51 +02:00
..
iscsi scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show() 2023-09-23 11:00:05 +02:00
loopback
sbp Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
tcm_fc mm: introduce page_size() 2019-09-24 15:54:08 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_alua.c scsi: target: Fix alua_tg_pt_gps_count tracking 2021-11-26 10:47:16 +01:00
target_core_alua.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2017-11-24 19:19:20 -10:00
target_core_configfs.c scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-05-17 11:43:51 +02:00
target_core_device.c scsi: target: core: Add TMF to tmr_list handling 2024-03-01 13:13:33 +01:00
target_core_fabric_configfs.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_fabric_lib.c scsi: target: fix PR IN / READ FULL STATUS for FC 2020-05-02 08:48:56 +02:00
target_core_file.c fix iov_iter_bvec() "direction" argument 2023-02-22 12:50:23 +01:00
target_core_file.h scsi: target: target/file: Add support of direct and async I/O 2018-05-14 22:40:08 -04:00
target_core_hba.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_iblock.c scsi: target/iblock: fix WRITE SAME zeroing 2020-05-06 08:15:14 +02:00
target_core_iblock.h
target_core_internal.h scsi: target: Fix ordered tag handling 2021-11-26 10:47:16 +01:00
target_core_pr.c scsi: target: core: Prevent underflow for service actions 2021-03-17 17:03:45 +01:00
target_core_pr.h scsi: target/core: Rework the SPC-2 reservation handling code 2019-04-12 20:20:05 -04:00
target_core_pscsi.c scsi: target: pscsi: Fix warning in pscsi_complete_cmd() 2021-05-11 14:04:08 +02:00
target_core_pscsi.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_rd.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_rd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
target_core_sbc.c scsi: target: Fix protect handling in WRITE SAME(32) 2021-07-28 13:30:56 +02:00
target_core_spc.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_stat.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_tmr.c scsi: target: core: Fix warning on RT kernels 2023-02-22 12:50:25 +01:00
target_core_tpg.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_transport.c scsi: target: core: Add TMF to tmr_list handling 2024-03-01 13:13:33 +01:00
target_core_ua.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
target_core_ua.h scsi: target: Fix handling of removed LUNs 2018-07-02 16:44:32 -04:00
target_core_user.c scsi: target: tcmu: Fix possible page UAF 2022-04-20 09:19:36 +02:00
target_core_xcopy.c scsi: target: avoid per-loop XCOPY buffer allocations 2021-09-22 12:26:25 +02:00
target_core_xcopy.h scsi: target: avoid per-loop XCOPY buffer allocations 2021-09-22 12:26:25 +02:00