Skip to contentSkip to conversation

neverallow and attributes

DISCUSSION Ole Kliemann 2 participants 2 messages Aug 27, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

If I do:

    attribute A;
    
    type T1_t;
    type T2_t;
    
    typeattribute T2_t A;
    
    allow A T1_t:file read;
    
    neverallow T2_t T1_t:file read;

I can compile and load the corresponding module. I can even do:

    allow A T1_t:file read;
    
    neverallow A T1_t:file read;

without problems.

I cannot do:

    allow T2_t T1_t:file read;
    
    neverallow A T1_t:file read;

The neverallow assertion does not find any allows that are constituted by allowing something for an attribute.

Is this normal behaviour?

Ole

#1 lore raw
Quoted 28 lines · Ole Kliemann

If I do:

    attribute A;
    
    type T1_t;
    type T2_t;
    
    typeattribute T2_t A;
    
    allow A T1_t:file read;
    
    neverallow T2_t T1_t:file read;

I can compile and load the corresponding module. I can even do:

    allow A T1_t:file read;
    
    neverallow A T1_t:file read;

without problems.

I cannot do:

    allow T2_t T1_t:file read;
    
    neverallow A T1_t:file read;
Quoted 4 lines

The neverallow assertion does not find any allows that are constituted by allowing something for an attribute.

Is this normal behaviour?

I would call that a bug. However, I'm not surprised, as Fedora disables the neverallow checking by default (expand-check=0
in /etc/selinux/semanage.conf), so it doesn't get much testing these days. Possibly the neverallow checking has never been updated to account for preservation of attributes in the kernel policy (originally all attributes were expanded at compile-time).

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.