All of lore.kernel.org
 help / color / mirror / Atom feed
From: KaiGai Kohei <kaigai@ak.jp.nec.com>
To: Eamon Walsh <ewalsh@tycho.nsa.gov>
Cc: method@manicmethod.com, jmorris@namei.org,
	selinux <selinux@tycho.nsa.gov>,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH] Permissive domain in userspace (Re: Some ideas in SE-PostgreSQL enhancement)
Date: Mon, 30 Mar 2009 11:55:53 +0900	[thread overview]
Message-ID: <49D034B9.9080406@ak.jp.nec.com> (raw)
In-Reply-To: <49CD8E68.9090004@tycho.nsa.gov>

Eamon Walsh wrote:
> KaiGai Kohei wrote:
>> KaiGai Kohei wrote:
>>   
>>> 4. Permissive domain in userspace
>>>
>>> It is an issue got sleep for a few months.
>>>   http://marc.info/?l=selinux&m=122337314619667&w=2
>>>     
>> It was discussed at the past a bit, but left it for several months.
>>
>> Now we have a new idea of permissive domain which allows certain
>> domains to work as if being in permissive mode.
>> The in-kernel SELinux can handle it well, but userspace object
>> managers could not handler it because we don't have an interface
>> to tell what domain is permissive.
>>
>> The attached patches are for the kernel and libselinux.
>>
>> The kernel patch adds a flags field on av_decision, and returns
>> it as the sixth parameter on the reply of /selinux/access.
>>
>> The libselinux patch enhance libselinux to understand it, and
>> two new interfaces are added.
>>  - security_compute_av_flags()
>>  - security_compute_av_flags_raw()
>> It also adds a new flags field on av_decision, but it is not
>> touched when we use the existing interfaces due to the binary
>> compatibility.
>>
>> The standard userspace avc uses _flags interface, instead of
>> existing one, so it enables to control permissive domain.
>>
>> IIRC, Eamon pointed out that it is preferable to put a new field
>> of 'permissive' than general purpose 'flags'. But it will require
>> interface changes, if we need more state in the future.
>> So, I don't change the implementation.
>>
>> Please comment anything.
>>
>> Thanks,
>>   
> 
> Don't have any immediate issues with the libselinux patches. Will wait
> on kernel acceptance.
> 
> Some general questions:
> 
> When the userspace AVC is configured in "enforcing" mode, which
> overrides the kernel setting, how should permissive domains be treated?

>From an analogy of the kernel, the object manager (kernel) allows
the permissive domains to override security policy setting, even if
it is configured as "enforcing mode".
I think the object manager (X, DBMS) should also allow the permissive
domains to override their access controls, because of symmetry.

> When the entire system is in permissive mode, should the permissive flag
> be returned as true for all domains?

I don't think it is correct manner, because the permissive flag shows
the domain (subject context) is configured as permissive domain, not
the global system state.

> /me wonders how long it will be before someone proposes permissive
> classes, or permissions ("permissive permissions"). Or marking
> individual tsid,ssid,tclass tuples as permissive. Just think of the
> problems we could solve.

This patch marks the permissive flag for an individual pair of tsid,
ssid and tclass in the result, but its value is determined by only
the property of tsid.

I don't think we have to hold the flag with the pair of them, but
it is worthfull from the viewpoint of implementation.
In the kernel, the avc_has_perm_noaudit() calls security_permissive_sid()
which aquires "policy_rwlock" to check permissive domain. The lock
operatins need unchached memory operatins, so heavy iteration of locks
(even if it is reader lock) on SMP system hits performance.
If an avc entry has the flag, we can check whether the given domain
is permissive or not, without "policy_rwlock".

If we have an entry something like "/selinux/permissive" to return
whether the given domain is permissive or not, I think we don't need
to have the flags field on security_compute_av(). It can be checked
on the creation of userspace avc entry, and checked it on later access
controls.

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>

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

  reply	other threads:[~2009-03-30  2:55 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 10:37 The status of SE-PostgreSQL KaiGai Kohei
2009-03-23 10:37 ` [refpolicy] " KaiGai Kohei
2009-03-23 14:56 ` Shaz
2009-03-23 14:57   ` Shaz
2009-03-23 15:19 ` Andy Warner
2009-03-24  2:14   ` KaiGai Kohei
2009-03-24  2:14     ` [refpolicy] " KaiGai Kohei
2009-03-25  6:54     ` Some ideas in SE-PostgreSQL enhancement (Re: The status of SE-PostgreSQL) KaiGai Kohei
2009-03-25  6:54       ` [refpolicy] " KaiGai Kohei
2009-03-25  7:45       ` Andy Warner
2009-03-25  8:20         ` KaiGai Kohei
2009-03-25  8:59           ` Andy Warner
2009-03-25 12:00             ` KaiGai Kohei
2009-03-25 17:02               ` Andy Warner
2009-03-26  0:13                 ` KaiGai Kohei
2009-03-25 17:43         ` Joshua Brindle
2009-03-25 19:42           ` Andy Warner
2009-03-27 15:43             ` Joshua Brindle
2009-03-27 16:25               ` Andy Warner
2009-03-27 17:15                 ` Joshua Brindle
2009-03-27 17:54                   ` Andy Warner
2009-03-27 18:12                     ` Joshua Brindle
2009-03-27 18:48                       ` Andy Warner
2009-03-27 19:53                         ` Joshua Brindle
2009-03-27 20:04                           ` Andy Warner
2009-03-27 23:59                           ` KaiGai Kohei
2009-03-28  7:17                             ` Andy Warner
2009-03-30  0:56                               ` KaiGai Kohei
2009-03-30  8:21                                 ` KaiGai Kohei
2009-03-30  9:58                                   ` Andy Warner
2009-03-30 13:22                                     ` KaiGai Kohei
2009-04-22  0:08                                   ` Eamon Walsh
2009-04-22  3:59                                     ` KaiGai Kohei
2009-05-01  4:54                                       ` Eamon Walsh
2009-05-07  1:34                                         ` KaiGai Kohei
2009-05-07  7:24                                           ` KaiGai Kohei
2009-03-30  9:49                                 ` Andy Warner
2009-03-26  5:50       ` [PATCH] Expose avc_netlink_loop() for applications (Re: Some ideas in SE-PostgreSQL enhancement) KaiGai Kohei
2009-03-26 23:28         ` Eamon Walsh
2009-03-26 23:41         ` Eamon Walsh
2009-03-27  0:35           ` KaiGai Kohei
2009-03-28  0:54             ` Eamon Walsh
2009-03-28  2:00               ` KaiGai Kohei
2009-03-30  4:56                 ` KaiGai Kohei
2009-03-26  6:11       ` [PATCH] database audit integration " KaiGai Kohei
2009-03-26  6:11         ` KaiGai Kohei
2009-03-26 21:45         ` John Dennis
     [not found]         ` <49CB313B.7020507@redhat.com>
2009-03-27  2:34           ` KaiGai Kohei
2009-03-27  2:34             ` KaiGai Kohei
2009-03-26  8:29       ` [PATCH] Permissive domain in userspace " KaiGai Kohei
2009-03-28  2:41         ` Eamon Walsh
2009-03-30  2:55           ` KaiGai Kohei [this message]
2009-03-31  1:45             ` KaiGai Kohei
2009-03-31 16:46               ` Stephen Smalley
2009-04-01  1:07                 ` [PATCH] Permissive domain in userspace object manager KaiGai Kohei
2009-04-01  1:41                   ` KaiGai Kohei
2009-04-01 12:34                   ` Stephen Smalley
2009-04-01 20:07                     ` Eric Paris
2009-04-01 22:53                   ` James Morris
2009-03-27  8:18       ` [PATCH] Policy rework for SE-PostgreSQL (Re: Some ideas in SE-PostgreSQL enhancement) KaiGai Kohei
2009-03-27  8:18         ` [refpolicy] " KaiGai Kohei
2009-03-27  9:44         ` Andy Warner
2009-03-27 11:20           ` KaiGai Kohei
2009-03-27 11:20             ` [refpolicy] " KaiGai Kohei
2009-03-27 11:45             ` Andy Warner
2009-03-27 11:45               ` [refpolicy] " Andy Warner
2009-03-27 12:17               ` KaiGai Kohei
2009-03-27 12:17                 ` [refpolicy] " KaiGai Kohei
2009-04-01  7:26       ` Correct manner to handler undefined classes/permissions? " KaiGai Kohei
2009-04-01 12:45         ` Stephen Smalley
2009-04-02  0:28           ` KaiGai Kohei
2009-03-23 15:25 ` The status of SE-PostgreSQL Stephen Smalley
2009-03-23 15:25   ` [refpolicy] " Stephen Smalley
2009-03-24  1:13   ` KaiGai Kohei
2009-03-24  1:13     ` [refpolicy] " KaiGai Kohei

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=49D034B9.9080406@ak.jp.nec.com \
    --to=kaigai@ak.jp.nec.com \
    --cc=ewalsh@tycho.nsa.gov \
    --cc=jmorris@namei.org \
    --cc=method@manicmethod.com \
    --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 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.