Re: [PATCH 12/19] CacheFiles: Permit a process's create SID to beoverridden

From: James Morris
Date: Wed Nov 15 2006 - 11:19:27 EST


On Wed, 15 Nov 2006, David Howells wrote:

> James Morris <jmorris@xxxxxxxxx> wrote:
>
> > > +static u32 selinux_set_fscreate_secid(u32 secid)
> > ...
> > The ability to set this needs to be mediated via MAC policy.
>
> There could a problem with that... Is it possible for there to be a race?

Well, the value can be changed at any time, so you could be using a
temporary fscreate value, or your new value could be overwritten
immediately by writing to /proc/$$/attr/fscreate

I think we need to add a separate field for this purpose, which can only
be written to via the in-kernel API and overrides fscreate.

> I have to call the function twice per cache op: once to set the file
> creation security ID and once to restore it back to what it was.
>
> However, what happens if I can't restore the original security ID (perhaps the
> rules changed between the two invocations)? I can't let the task continue as
> it's now running with the wrong security...

Kill the task?



- James
--
James Morris
<jmorris@xxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/