Received: from jazzswing.ncsc.mil (jazzswing.ncsc.mil [144.51.68.65]) by tycho.ncsc.mil (8.12.8/8.12.8) with ESMTP id i39CN1Rb024243 for ; Fri, 9 Apr 2004 08:23:01 -0400 (EDT) Received: from jazzswing.ncsc.mil (localhost [127.0.0.1]) by jazzswing.ncsc.mil with ESMTP id i39CL0UZ024729 for ; Fri, 9 Apr 2004 12:21:01 GMT Received: from omta08.mta.everyone.net (sitemail2.everyone.net [216.200.145.36]) by jazzswing.ncsc.mil with ESMTP id i39CL0mT024726 for ; Fri, 9 Apr 2004 12:21:00 GMT Date: Fri, 09 Apr 2004 20:22:52 +0800 Subject: Re: initial load_policy problem Message-ID: MIME-Version: 1.0 (Generated by Pantomime 1.1.2) From: Rogelio Serrano To: Stephen Smalley Cc: selinux@tycho.nsa.gov In-Reply-To: <1081513170.8524.16.camel@moss-spartans.epoch.ncsc.mil> Content-Type: text/plain; charset="us-ascii"; format="flowed" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2004-04-09 20:19:30 +0800 Stephen Smalley wrote: > On Fri, 2004-04-09 at 06:37, Rogelio Serrano wrote: >> How long after the policy load is /dev/console supposed to >> become console_device_t? immediately after policy load the >> label of /dev/console is system_u:system_r:kernel_t. > > No it isn't. The label of the open file description is > kernel_t, since > it was opened by a kernel thread, but the label of the device > inode is > console_device_t. Remember that SELinux labels and controls > open file > descriptions (the state referenced by a file descriptor) as > well as > files themselves, because they can be shared among processes. > The open > file descriptions are labeled based on the process that > performed the > open, so when an initial kernel thread opens /dev/console, the > open file > is labeled kernel_t. > >> avc: denied { use } for pid=18 exe=/bin/bash path=/dev/console >> dev=hda16 ino=17895218 scontext=system_u:system_r:initrc_t >> tcontext=system_u:system_r:kernel_t tclass=fd > > Look closely at the above avc message. The tclass is "fd" > (file > descriptor, or more accurately, open file description); the > permission > is "use". The question is whether initrc_t should be > inheriting this > descriptor, not whether it can access /dev/console (the latter > is also > checked, but is likely allowed). > I understand. Im going to audit all the boot programs. At least all the programs called by the init scripts. I will try to avoid adding permissions to the default policy. Thanks. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using the GPG bundle for GNUMail.app iD8DBQFAdpWayihxuQOYt8wRAiNPAJ9lxgiva7kpDog/U907vHEhUn/QhQCgsHGL jPVspP8stzd+iENG0EEDXf8= =md83 -----END PGP SIGNATURE----- -- 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.