Re: [PATCH 2/3] CRED: Split the task security data and move part of it into struct cred

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Howells
Date: Thursday, September 20, 2007 - 10:17 am

Casey Schaufler <casey@schaufler-ca.com> wrote:


If you wish.  Personally, I find it clearer than object or subject.


Filesystem?  CacheFiles is acting on behalf of a filesystem and must override
the context that that filesystem was using, so that it can access a different
filesystem.


99.99% probable that I will want a different subjective context for talking to
the cache to the objective context of the task I'm doing work on behalf of.


What daemon are you referring to?

You've misunderstood, I think.  Consider readpages.  CacheFiles really wants to
run in the process context of whoever called readpages.  The main reason for
this is one of performance: readpages() is called an awful lot, and we don't
want to be changing process context at least twice per call if we can avoid it.


Indeed.  I have mentioned that I intend to create a patch to provide an LSM
hook by which a kernel service can ask the LSM module for a new cred struct,
appropriate to that service.  That way, all details of SIDs, secids,
transformations, etc are hidden inside the LSM module.


Sigh.  Only by saving and restoring the complete credential context from/to the
task struct.


Exchanging task structs is highly impractical, I think.


Performance.


This is actually the simpler and cleaner solution.  It has been assumed,
generally, to this point that subjective context == objective context, but we
have two cases where we need to break that assumption.


? I didn't mention passing a cred, did I?


Actually, I think you were right.  I shouldn't be exposing secids like that.
There's no requirement for an LSM to have such a concept.


Of course the LSM must be involved, but secids aren't needed.


No, all I really need is something like:

	struct cred *security_get_kernel_service_cred(const char *name);

And maybe:

	int security_create_files_as(struct cred *, struct inode *);

So that I can say I want to be able to create files that look the same as that
inode there.  The LSM can then check that the subjective context in the cred
struct is allowed to do that.

David
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] Introduce credential record, David Howells, (Wed Sep 19, 9:17 am)
[PATCH 1/3] CRED: Introduce a COW credentials record, David Howells, (Wed Sep 19, 9:17 am)
Re: [PATCH 2/3] CRED: Split the task security data and mov ..., David Howells, (Thu Sep 20, 10:17 am)