All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov, James Morris <jmorris@namei.org>,
	Eric Paris <eparis@parisplace.org>,
	"Serge E. Hallyn" <serue@us.ibm.com>
Subject: Re: [RFC][PATCH] selinux:  support 64-bit capabilities
Date: Wed, 06 Feb 2008 19:52:52 -0500	[thread overview]
Message-ID: <47AA5664.8020903@manicmethod.com> (raw)
In-Reply-To: <1202322530.27371.171.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Wed, 2008-02-06 at 11:22 -0500, Stephen Smalley wrote:
>   
>> 64-bit capability support has gone into mainline.
>> Update SELinux to correctly handle 64-bit capabilities.
>>
>> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
>> index e5ed075..fa4b021 100644
>> --- a/security/selinux/hooks.c
>> +++ b/security/selinux/hooks.c
>> @@ -1278,6 +1278,8 @@ static int task_has_capability(struct task_struct *tsk,
>>  {
>>  	struct task_security_struct *tsec;
>>  	struct avc_audit_data ad;
>> +	u16 sclass;
>> +	u32 av = CAP_TO_MASK(cap);	
>>  
>>  	tsec = tsk->security;
>>  
>> @@ -1285,8 +1287,17 @@ static int task_has_capability(struct task_struct *tsk,
>>  	ad.tsk = tsk;
>>  	ad.u.cap = cap;
>>  
>> -	return avc_has_perm(tsec->sid, tsec->sid,
>> -			    SECCLASS_CAPABILITY, CAP_TO_MASK(cap), &ad);
>> +	switch (CAP_TO_INDEX(cap)) {
>> +	case 0:
>> +		sclass = SECCLASS_CAPABILITY;
>> +		break;
>> +	case 1:
>> +		sclass = SECCLASS_CAPABILITY2;
>> +		break;
>> +	default:
>> +		return -EPERM;
>>     
>
> Should likely make this something like:
> 	printk(KERN_WARNING "SELinux:  unknown capability %d\n", cap);
> 	if (selinux_enforcing)
> 		return -EPERM;
> 	else
> 		return 0;
>
> Then, if/when people introduce capabilities without updating SELinux,
> we'll get a warning but permissive mode will allow the operation to
> proceed.
>
>   

Are we going to do some magic in the toolchain to treat caps as 1 class 
in source policy but split it up in binary? I remember that being a 
possibility at some point.




--
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.

  parent reply	other threads:[~2008-02-07  0:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 16:22 [RFC][PATCH] selinux: support 64-bit capabilities Stephen Smalley
2008-02-06 17:15 ` Serge E. Hallyn
2008-02-06 18:28 ` Stephen Smalley
2008-02-07  0:04   ` James Morris
2008-02-07 13:53     ` Stephen Smalley
2008-02-07 14:03       ` Serge E. Hallyn
2008-02-07 15:15         ` Stephen Smalley
2008-02-07 16:14           ` Casey Schaufler
2008-02-07  0:52   ` Joshua Brindle [this message]
2008-02-07 13:55     ` Stephen Smalley
2008-02-07  6:22   ` James Morris

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=47AA5664.8020903@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=serue@us.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.