target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/2] Fix SELinux denials against target driver
@ 2024-02-15 14:39 Maurizio Lombardi
  2024-02-15 14:39 ` [PATCH V2 1/2] target: fix selinux error when systemd-modules loads the target module Maurizio Lombardi
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Maurizio Lombardi @ 2024-02-15 14:39 UTC (permalink / raw)
  To: michael.christie
  Cc: d.bogdanov, target-devel, martin.petersen, linux-scsi, james.bottomley

Steps to reproduce:

1) install the ibacm, rdma-core and targetcli
2) service ibacm start   (ignore the errors)
3) Look at the dmesg, you will see an error message like
   "db_root: cannot open: /etc/target"

4) Execute $ sudo ausearch -m AVC,USER_AVC -ts recent

   type=AVC msg=audit(1707990698.893:610): avc:  denied  { read } for  pid=26447
   comm="systemd-modules" name="target" dev="dm-0" ino=973050 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 inspired by commit 581dd69830341d299b0c097fc366097ab497d679

V2: fix a memory leak in the error path, add a patch to set
    a freed pointer to NULL to avoid possible double frees

Maurizio Lombardi (2):
  target: fix selinux error when systemd-modules loads the target module
  target: set the xcopy_wq pointer to NULL after free.

 drivers/target/target_core_configfs.c | 12 ++++++++++++
 drivers/target/target_core_xcopy.c    |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

-- 
2.39.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-04-06  1:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 14:39 [PATCH V2 0/2] Fix SELinux denials against target driver Maurizio Lombardi
2024-02-15 14:39 ` [PATCH V2 1/2] target: fix selinux error when systemd-modules loads the target module Maurizio Lombardi
2024-02-15 16:44   ` michael.christie
2024-02-15 17:07     ` Maurizio Lombardi
2024-02-15 21:06       ` Mike Christie
2024-02-15 14:39 ` [PATCH V2 2/2] target: set the xcopy_wq pointer to NULL after free Maurizio Lombardi
2024-02-15 16:42   ` michael.christie
2024-02-15 17:08     ` Maurizio Lombardi
2024-04-06  1:58 ` (subset) [PATCH V2 0/2] Fix SELinux denials against target driver Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).