All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Joe Nall <joe@nall.com>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: mdadm failure in MLS Enforcing
Date: Wed, 11 Feb 2009 09:26:02 -0500	[thread overview]
Message-ID: <1234362362.12067.104.camel@localhost.localdomain> (raw)
In-Reply-To: <F2BE7671-FBDA-4F31-AEE7-E75BDA1337D2@nall.com>

On Tue, 2009-02-10 at 22:17 -0600, Joe Nall wrote:
> mdadm runs system_u:system_r:mdadm_t:s0-s15:c0.c1023 during boot and  
> can't access block devices that are  
> system_u:object_r:fixed_disk_device_t:s15:c0.c1023
> https://bugzilla.redhat.com/show_bug.cgi?id=485006
> 
> Posted here instead of fedora-selinux because I don't think it is  
> fedora specific.
> 
> Boot avcs:
> 
> node=test type=AVC msg=audit(1234315341.183:18): avc:  denied   
> { read } for  pid=1501 comm="mdadm" name="sdb2" dev=tmpfs ino=508  
> scontext=system_u:system_r:mdadm_t:s0-s15:c0.c1023  
> tcontext=system_u:object_r:fixed_disk_device_t:s15:c0.c1023  
> tclass=blk_file
> 
>          Was caused by:
>                  Policy constraint violation.
> 
>                  May require adding a type attribute to the domain or  
> type to satisfy the constraint.
> 
>                  Constraints are defined in the policy sources in  
> policy/constraints (general), policy/mcs (MCS), and policy/mls (MLS).
> 
> node=test type=AVC msg=audit(1234315341.184:19): avc:  denied   
> { read } for  pid=1457 comm="mdadm" name=".tmp-9-1" dev=tmpfs ino=5859  
> scontext=system_u:system_r:mdadm_t:s0-s15:c0.c1023  
> tcontext=system_u:object_r:device_t:s0 tclass=blk_file
> 
>          Was caused by:
>                  Missing type enforcement (TE) allow rule.
> 
>                  You can use audit2allow to generate a loadable module  
> to allow this access.
> 
> node=test type=AVC msg=audit(1234315341.188:20): avc:  denied   
> { getattr } for  pid=1457 comm="mdadm" path="/proc/kcore" dev=proc  
> ino=4026531986 scontext=system_u:system_r:mdadm_t:s0-s15:c0.c1023  
> tcontext=system_u:object_r:proc_kcore_t:s15:c0.c1023 tclass=file
> 
>          Was caused by:
>                  Policy constraint violation.
> 
>                  May require adding a type attribute to the domain or  
> type to satisfy the constraint.
> 
>                  Constraints are defined in the policy sources in  
> policy/constraints (general), policy/mcs (MCS), and policy/mls (MLS).
> 
> so I added this policy:
> 
> diff -up serefpolicy-3.5.13/policy/modules/system/raid.fc.orig  
> serefpolicy-3.5.13/policy/modules/system/raid.fc
> --- serefpolicy-3.5.13/policy/modules/system/raid.fc.orig	2009-02-10  
> 19:41:17.000000000 -0600
> +++ serefpolicy-3.5.13/policy/modules/system/raid.fc	2009-02-10  
> 19:41:31.000000000 -0600
> @@ -2,4 +2,4 @@
>   /sbin/mdadm		--	gen_context(system_u:object_r:mdadm_exec_t,s0)
>   /sbin/mdmpd		--	gen_context(system_u:object_r:mdadm_exec_t,s0)
> 
> -/var/run/mdadm(/.*)?		gen_context(system_u:object_r:mdadm_var_run_t,s0)
> +/var/run/mdadm(/.*)?		 
> gen_context(system_u:object_r:mdadm_var_run_t,mls_systemhigh)
> diff -up serefpolicy-3.5.13/policy/modules/system/raid.te.orig  
> serefpolicy-3.5.13/policy/modules/system/raid.te
> --- serefpolicy-3.5.13/policy/modules/system/raid.te.orig	2009-02-10  
> 19:33:59.000000000 -0600
> +++ serefpolicy-3.5.13/policy/modules/system/raid.te	2009-02-10  
> 19:39:58.000000000 -0600
> @@ -9,6 +9,10 @@ policy_module(raid, 1.7.0)
>   type mdadm_t;
>   type mdadm_exec_t;
>   init_daemon_domain(mdadm_t,mdadm_exec_t)
> +ifdef(`enable_mls',`
> +	init_ranged_daemon_domain(mdadm_t, mdadm_exec_t,mls_systemhigh)
> +')
> +
>   role system_r types mdadm_t;
> 
>   type mdadm_var_run_t;
> 
> which does transition to SystemHigh using run_init in permissive, but  
> doesn't affect this bug.
> 
> Clues?

I'm not sure what you mean by "doesn't affect this bug".  Did mdadm
transition to systemhigh at boot or not?

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2009-02-11 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11  4:17 mdadm failure in MLS Enforcing Joe Nall
2009-02-11 14:26 ` Stephen Smalley [this message]
2009-02-11 14:47   ` Joe Nall
2009-02-11 15:00     ` Stephen Smalley
2009-02-11 16:15       ` Joe Nall
2009-02-11 17:33         ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234362362.12067.104.camel@localhost.localdomain \
    --to=sds@tycho.nsa.gov \
    --cc=joe@nall.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.