Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id s4RCJJNU003537 for ; Tue, 27 May 2014 08:19:19 -0400 Received: from ferret (fw5540.nrl.navy.mil [132.250.196.100]) by ccs.nrl.navy.mil (8.14.4/8.14.4) with ESMTP id s4RCJJMD018174 for ; Tue, 27 May 2014 08:19:19 -0400 From: "Kim Lawson-Jenkins" To: Subject: AVCs errors generated when CLI comands executed Date: Tue, 27 May 2014 08:21:48 -0400 Message-ID: <001c01cf79a6$3ba6e880$b2f4b980$@nrl.navy.mil> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001D_01CF7984.B4954880" Reply-To: kim.lawson-jenkins@nrl.navy.mil List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: This is a multipart message in MIME format. ------=_NextPart_000_001D_01CF7984.B4954880 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, We're running SELinux on an embedded system using a reference policy from the Yocto project. RAM, which is used instead of flash, is mounted after SELinux relabeling completes and the files have default labels after a reboot. I've added restorecon -R /dev to a rc.init to set the contexts correctly but the files on RAM still have the default label. After logging in, I'm able to execute SELinux commands to modify the policy and fix the labels, but avcs are generated for every command. Here are some examples - May 20 20:04:16 guard kernel: type=1400 audit(1400616256.808:53): avc: denied { relabelto } for pid=1536 comm="restorecon" name="sipc_mq1 " dev="ram1" ino=14341 scontext=root:sysadm_r:setfiles_t:s0-s15:c0.c1023 tcontext=system_u:object_r:ioi_orch_cq_t:s0 tclass=file May 20 20:04:16 guard kernel: type=1400 audit(1400616256.839:54): avc: denied { associate } for pid=1536 comm="restorecon" name="sipc_mq2 " dev="ram1" ino=14341 scontext=system_u:object_r:ioi_orch_cq_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem May 20 20:04:16 guard kernel: type=1400 audit(1400616256.864:55): avc: denied { relabelto } for pid=1536 comm="restorecon" name="sipc_mq3 " dev="ram1" ino=14342 scontext=root:sysadm_r:setfiles_t:s0-s15:c0.c1023 tcontext=system_u:object_r:orch_ioi_cq_t:s0 tclass=file May 20 20:04:16 guard kernel: type=1400 audit(1400616256.888:56): avc: denied { associate } for pid=1536 comm="restorecon" name="sipc_mq4" dev="ram1" ino=14342 scontext=system_u:object_r:orch_ioi_cq_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem May 20 20:04:16 guard kernel: type=1400 audit(1400616256.907:57): avc: denied { relabelto } for pid=1536 comm="restorecon" name="sipc_mq5" dev="ram1" ino=14343 scontext=root:sysadm_r:setfiles_t:s0-s15:c0.c1023 tcontext=system_u:object_r:ioi_orch_dq_t:s0 tclass=file I don't understand why the restorecon does not apply the correct labels when the init script is executed but it does when I execute the command as admin. Also, I don't know why the AVC errors are generated when I execute the commands as admin. Any feedback would be greatly appreciated. Kim ------=_NextPart_000_001D_01CF7984.B4954880 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

We’re = running SELinux on an embedded system using a reference policy from the = Yocto project.   RAM, which is used instead of flash, is = mounted after SELinux relabeling completes and the files have default = labels after a reboot.  I’ve added restorecon -R /dev to a = rc.init  to set the contexts correctly but the files on RAM still = have the default label.  After logging in, I’m able to = execute SELinux commands to modify the policy and fix the labels, but = avcs are generated for every command.  Here are some examples = –

 

May 20 20:04:16 guard kernel: type=3D1400 = audit(1400616256.808:53): avc:  denied  { relabelto } = for  pid=3D1536 comm=3D"restorecon" name=3D"sipc_mq1 = " dev=3D"ram1" ino=3D14341 = scontext=3Droot:sysadm_r:setfiles_t:s0-s15:c0.c1023 = tcontext=3Dsystem_u:object_r:ioi_orch_cq_t:s0 = tclass=3Dfile

May 20 20:04:16 guard = kernel: type=3D1400 audit(1400616256.839:54): avc:  denied  { = associate } for  pid=3D1536 comm=3D"restorecon" = name=3D"sipc_mq2 " dev=3D"ram1" ino=3D14341 = scontext=3Dsystem_u:object_r:ioi_orch_cq_t:s0 = tcontext=3Dsystem_u:object_r:fs_t:s0 = tclass=3Dfilesystem

May 20 20:04:16 = guard kernel: type=3D1400 audit(1400616256.864:55): avc:  = denied  { relabelto } for  pid=3D1536 = comm=3D"restorecon" name=3D"sipc_mq3 " = dev=3D"ram1" ino=3D14342 = scontext=3Droot:sysadm_r:setfiles_t:s0-s15:c0.c1023 = tcontext=3Dsystem_u:object_r:orch_ioi_cq_t:s0 = tclass=3Dfile

May 20 20:04:16 guard = kernel: type=3D1400 audit(1400616256.888:56): avc:  denied  { = associate } for  pid=3D1536 comm=3D"restorecon" = name=3D"sipc_mq4" dev=3D"ram1" ino=3D14342 = scontext=3Dsystem_u:object_r:orch_ioi_cq_t:s0 = tcontext=3Dsystem_u:object_r:fs_t:s0 = tclass=3Dfilesystem

May 20 20:04:16 = guard kernel: type=3D1400 audit(1400616256.907:57): avc:  = denied  { relabelto } for  pid=3D1536 = comm=3D"restorecon" name=3D"sipc_mq5" = dev=3D"ram1" ino=3D14343 = scontext=3Droot:sysadm_r:setfiles_t:s0-s15:c0.c1023 = tcontext=3Dsystem_u:object_r:ioi_orch_dq_t:s0 = tclass=3Dfile

 

I don’t understand why the restorecon does not = apply the correct labels when the init script is executed but it does = when I execute the command as admin.  Also, I don’t know why = the AVC errors are generated when I execute the commands as admin.  = Any feedback would be greatly appreciated.

 

 

Kim

 

------=_NextPart_000_001D_01CF7984.B4954880--