All of lore.kernel.org
 help / color / mirror / Atom feed
From: cpebenito@tresys.com (Christopher J. PeBenito)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH]: dontaudit sys_module wpa_supplicant
Date: Mon, 21 Mar 2011 09:23:43 -0400	[thread overview]
Message-ID: <4D87515F.3040201@tresys.com> (raw)
In-Reply-To: <1300637900.27586.9.camel@tesla.lan>

On 03/20/11 12:18, Guido Trentalancia wrote:
> On Sun, 2011-03-20 at 16:56 +0100, Sven Vermeulen wrote:
>> On Sun, Mar 20, 2011 at 04:47:27PM +0100, Guido Trentalancia wrote:
>>>> The moment you set kernel_load_module(NetworkManager_t) you're all set. The
>>>> neverallow is on all domains that do not have the can_load_kernmodule
>>>> attribute set, and with kernel_load_moduel() you set it for the specified
>>>> domain.
>>>
>>> The "neverallow" rule in kernel/kernel.te prevents NetworkManager_t from
>>> having the "sys_module" capability.
>>
>> In kernel/kernel.te:
>>
>>   neverallow ~{ can_load_kernmodule kern_unconfined } self:capability sys_module;
>>
>> The kernel_load_module interface:
>>
>>   interface(`kernel_load_module',`
>>           gen_require(`
>>                   attribute can_load_kernmodule;
>>           ')
>>   
>>           allow $1 self:capability sys_module;
>>           typeattribute $1 can_load_kernmodule;
>>   
>>           # load_module() calls stop_machine() which
>>           # calls sched_setscheduler()
>>           allow $1 self:capability sys_nice;
>>           kernel_setsched($1)
>>   ')
>>   
>> When you use kernel_load_module(NetworkManager_t), then the typeattribute
>> will add "can_load_kernmodule" as an attribute to the NetworkManager_t
>> domain. The neverallow works on all but those domains having
>> can_load_kernmodule and/or kern_unconfined set as an attribute.
> 
> It seems quite difficult to explain this...
> 
> I do not want to break things for distributions that do not want
> wpa_supplicant to load kernel modules and in any case I would like to
> hear from Christopher.
> 
> So unless Dan Walsh changes his mind there needs to be at least one
> ifdef (for DISTRO=redhat).
> 
> I am happy to prepare a patch which does can_load_kernmodule()/dontaudit
> depending on the distribution, but I need to hear from people with
> authority for each distribution. And Christopher should decide what
> would be the default behaviour.
> 
> It is perfectly fine to me (and I would probably be happier) if the
> default behaviour is can_load_kernmodule() as I do not particularly like
> "dontaudit" for stuff which just logs once (but Christopher has a
> different opinion on this, so once again nothing can be changed before
> Monday).

I would rather not allow this.  We don't want network-facing services
loading kernel modules.


-- 
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com

  reply	other threads:[~2011-03-21 13:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-20  1:24 [refpolicy] [PATCH]: dontaudit sys_module wpa_supplicant Guido Trentalancia
2011-03-20  7:12 ` Russell Coker
2011-03-20 14:53   ` Guido Trentalancia
2011-03-20 15:05     ` Sven Vermeulen
2011-03-20 15:47       ` Guido Trentalancia
2011-03-20 15:56         ` Sven Vermeulen
2011-03-20 16:18           ` Guido Trentalancia
2011-03-21 13:23             ` Christopher J. PeBenito [this message]
2011-03-20 21:55     ` Russell Coker
2011-03-20 22:41       ` Guido Trentalancia
2011-03-22 12:11         ` Daniel J Walsh
2011-03-22 13:42           ` Eric Paris
2011-03-23 14:59             ` Guido Trentalancia
2011-03-22 15:01           ` Guido Trentalancia
  -- strict thread matches above, loose matches on Subject: below --
2011-03-21 14:07 [refpolicy] R: " Guido Trentalancia
2011-03-21 17:54 ` [refpolicy] " Guido Trentalancia
2011-03-19 20:13 Guido Trentalancia
2011-03-20  0:11 ` Russell Coker

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=4D87515F.3040201@tresys.com \
    --to=cpebenito@tresys.com \
    --cc=refpolicy@oss.tresys.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.