public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald@redhat.com>
To: Eric Paris <eparis@redhat.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>,
	linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov,
	greg@kroah.com, sds@tycho.nsa.gov, dwalsh@redhat.com
Subject: Re: selinux vs devtmpfs (vs udev)
Date: Tue, 31 Aug 2010 10:44:55 +0200	[thread overview]
Message-ID: <4C7CC107.1050304@redhat.com> (raw)
In-Reply-To: <1283210070.3284.139.camel@dhcp231-106.rdu.redhat.com>

On 08/31/2010 01:14 AM, Eric Paris wrote:
> On Sat, 2010-08-28 at 11:57 +0200, Kay Sievers wrote:
>> On Sat, Aug 28, 2010 at 01:00, Eric Paris<eparis@redhat.com>  wrote:
>
>>> In the new new days of devtmpfs things aren't as nice.  The kernel is
>>> magically creating files in /dev.  These are getting created with the
>>> 'default' SELinux context.  So herein lies the problem.
>>>
>>> The first program that tries to access these files get denied by
>>> SELinux.  Now udev actually has logic in it to fix the label on any
>>> closed device file, so udev will at that point swoop in, fix the label,
>>> and the next program that tries to use the file will work just fine.  Oh
>>> fun!
>
>> Udev should still label all device nodes, even when they are created
>> by the kernel. Devtmpfs or not should not make a difference here.
>>
>> I guess it's a udev bug introduced with:
>>    http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=578cc8a8085a47c963b5940459e475ac5f07219c
>>
>> and we just need to fix that.
>
> Looks like the likely cause.  I see a note in one of the bugzillas that
> says:
>
> Aug 30 14:03:09 pippin udevd-work[347]: preserve file '/dev/dri/card0',
> because it has correct dev_t
>
> Which is certainly the part of code in question.  Do you have a quick
> fix in mind that you plan to push upstream or should I ask the RH udev
> guy to come up with something?
>
> -Eric
>

The RH udev guy says:

This patch was introduced, because Red Hat engineers requested, that the selinux 
context should not be modified, after they set their own custom context (virtual 
machine management).

So, either we differentiate between "add" and "change" events, or we should 
check against the "kernel default" selinux context, before we call 
udev_selinux_lsetfilecon().


  reply	other threads:[~2010-08-31  8:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 23:00 selinux vs devtmpfs (vs udev) Eric Paris
2010-08-28  9:57 ` Kay Sievers
2010-08-30 23:14   ` Eric Paris
2010-08-31  8:44     ` Harald Hoyer [this message]
2010-08-31 14:11       ` Daniel J Walsh
2010-08-31 14:39         ` Harald Hoyer
2010-08-31 14:56           ` Daniel J Walsh
2010-08-31 14:57           ` Daniel J Walsh
2010-08-31 15:16             ` Eric Paris
2010-08-31 15:22               ` Daniel J Walsh
2010-08-31 15:26                 ` Eric Paris
2010-08-31 15:49                   ` Harald Hoyer
2010-08-31 19:32                     ` Kay Sievers
2010-08-31 19:37                       ` Daniel J Walsh
2010-08-31 20:51                       ` Eric Paris
2010-09-01 16:08                         ` Stephen Smalley
2010-09-01 17:59                           ` Kay Sievers
2010-09-01 19:44                           ` Daniel J Walsh
2010-08-31 21:55                       ` Harald Hoyer

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=4C7CC107.1050304@redhat.com \
    --to=harald@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=eparis@redhat.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox