Skip to contentSkip to conversation

[Fwd: cups AVC...]

Fwd: cups AVC... Daniel J Walsh 4 participants 10 messages Jul 20, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

Kernel problem?

-------- Original Message --------
Subject: cups AVC...
Date: Fri, 20 Jul 2007 07:04:08 -0700
From: Tom London <[email protected]>
To: fedora-selinux <[email protected]>

Seem to be getting this one from cups. Haven't seen 'anon_inodefs' before....

Printing to HP5MP seems to work however....

tom

type=AVC msg=audit(1184938825.408:32): avc: denied { ioctl } for pid=5296 comm="cupsd" name="[eventpoll]" dev=anon_inodefs ino=385 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file type=SYSCALL msg=audit(1184938825.408:32): arch=40000003 syscall=54 success=no exit=-13 a0=1 a1=5401 a2=bfda72ac a3=bfda73cc items=0 ppid=5295 pid=5296 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) comm="cupsd" exe="/usr/sbin/cupsd" subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null) type=AVC_PATH msg=audit(1184938825.408:32): path="anon_inode:[eventpoll]" type=LABEL_LEVEL_CHANGE msg=audit(1184938825.408:33): user pid=5296 uid=0 auid=500 subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 msg='printer=HP5MP uri=hp:/par/HP_LaserJet_5MP?device=/dev/parport0 banners=none,none range=unknown: exe="/usr/sbin/cupsd" (hostname=localhost.localdomain, addr=127.0.0.1, terminal=? res=success)'

Signature · 12 lines
Tom London

--
fedora-selinux-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-selinux-list


--
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.
#1 lore raw
Quoted 1 line · Daniel J Walsh

Kernel problem?

Yet another pseudo filesystem type, with no entry in policy to configure labeling for it. Looks like it allocates exactly one inode that is shared for all instances, to be used by things like eventpoll, eventfd, signalfd, and timerfd. Replaces eventpollfs.

Given that there is a single shared inode, I guess you want a genfscon statement rather than fs_use_task, and then allow access everywhere that access was given for e.g. eventpollfs.

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

Quoted 31 lines

-------- Original Message --------
Subject: cups AVC...
Date: Fri, 20 Jul 2007 07:04:08 -0700
From: Tom London <[email protected]>
To: fedora-selinux <[email protected]>

Seem to be getting this one from cups. Haven't seen 'anon_inodefs' before....

Printing to HP5MP seems to work however....

tom

type=AVC msg=audit(1184938825.408:32): avc: denied { ioctl } for pid=5296 comm="cupsd" name="[eventpoll]" dev=anon_inodefs ino=385 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file type=SYSCALL msg=audit(1184938825.408:32): arch=40000003 syscall=54 success=no exit=-13 a0=1 a1=5401 a2=bfda72ac a3=bfda73cc items=0 ppid=5295 pid=5296 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) comm="cupsd" exe="/usr/sbin/cupsd" subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null) type=AVC_PATH msg=audit(1184938825.408:32): path="anon_inode:[eventpoll]" type=LABEL_LEVEL_CHANGE msg=audit(1184938825.408:33): user pid=5296 uid=0 auid=500 subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 msg='printer=HP5MP uri=hp:/par/HP_LaserJet_5MP?device=/dev/parport0 banners=none,none range=unknown: exe="/usr/sbin/cupsd" (hostname=localhost.localdomain, addr=127.0.0.1, terminal=? res=success)'

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.
#2 lore raw
Quoted 4 lines · Stephen Smalley

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

What about some way of recognising that there is no policy at all for the fstype, and just allowing the access (with a warning) ?

- James

Signature · 7 lines
James Morris
<[email protected]>

--
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.
#3 lore raw
Quoted 9 lines · James Morris
Quoted 4 lines · Stephen Smalley

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

What about some way of recognising that there is no policy at all for the fstype, and just allowing the access (with a warning) ?

What, fail open?

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.
#4 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 7 lines
Quoted 4 lines

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

What about some way of recognising that there is no policy at all for the fstype, and just allowing the access (with a warning) ?

What, fail open?

Only in the case where the kernel has been updated to a development version and policy has not.

Signature · 7 lines
James Morris
<[email protected]>

--
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.
#5 lore raw
Quoted 7 lines · James Morris
Quoted 5 lines · Stephen Smalley
Quoted 5 lines
Quoted 4 lines

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

What about some way of recognising that there is no policy at all for the fstype, and just allowing the access (with a warning) ?

What, fail open?

Only in the case where the kernel has been updated to a development version and policy has not.

Well, we can't tell that in the kernel code; all we know is that a filesystem type is being registered that we don't know how to handle, and we don't want to give access by default (at least not without some further policy option, akin to the one for Eric's patches for allowing unknown permissions by default - if those patches ever materialize).

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.
#6 lore raw
Quoted 1 line · Stephen Smalley

if those patches ever materialize).

It's actually the number one thing on my list! I wanted to be working
on it today, but i'm having some systems troubles. (one machine I
think glibc is screwed up and another machine I can't boot git kernels, they panic almost on startup)

-Eric

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

#7 lore raw
In reply to Stephen Smalley
Quoted 3 lines · Stephen Smalley

and we don't want to give access by default (at least not without some further policy option, akin to the one for Eric's patches for allowing unknown permissions by default - if those patches ever materialize).

That was the line of thinking.

- James

Signature · 7 lines
James Morris
<[email protected]>

--
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.
#8 lore raw
In reply to Stephen Smalley
Quoted 10 lines · Stephen Smalley
Quoted 2 lines · Daniel J Walsh

Kernel problem?

Yet another pseudo filesystem type, with no entry in policy to configure labeling for it. Looks like it allocates exactly one inode that is shared for all instances, to be used by things like eventpoll, eventfd, signalfd, and timerfd. Replaces eventpollfs.

Quoted 42 lines

Given that there is a single shared inode, I guess you want a genfscon statement rather than fs_use_task, and then allow access everywhere that access was given for e.g. eventpollfs.

Yuck. We need a better way to handle these things, to avoid having to touch policy configuration each time a new pseudo fs type is introduced. Possibly the file_system_type structure could also specify labeling behavior for security modules.

Quoted 32 lines

-------- Original Message --------
Subject: cups AVC...
Date: Fri, 20 Jul 2007 07:04:08 -0700
From: Tom London <[email protected]>
To: fedora-selinux <[email protected]>

Seem to be getting this one from cups. Haven't seen 'anon_inodefs' before....

Printing to HP5MP seems to work however....

tom

type=AVC msg=audit(1184938825.408:32): avc: denied { ioctl } for pid=5296 comm="cupsd" name="[eventpoll]" dev=anon_inodefs ino=385 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file type=SYSCALL msg=audit(1184938825.408:32): arch=40000003 syscall=54 success=no exit=-13 a0=1 a1=5401 a2=bfda72ac a3=bfda73cc items=0 ppid=5295 pid=5296 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) comm="cupsd" exe="/usr/sbin/cupsd" subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null) type=AVC_PATH msg=audit(1184938825.408:32): path="anon_inode:[eventpoll]" type=LABEL_LEVEL_CHANGE msg=audit(1184938825.408:33): user pid=5296 uid=0 auid=500 subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 msg='printer=HP5MP uri=hp:/par/HP_LaserJet_5MP?device=/dev/parport0 banners=none,none range=unknown: exe="/usr/sbin/cupsd" (hostname=localhost.localdomain, addr=127.0.0.1, terminal=? res=success)'

I am just adding:

genfscon anon_inodefs / gen_context(system_u:object_r:eventpollfs_t,s0)

Does that look ok?

I also notice in /proc/filesystem that there is a securityfs which we do not define in policy. Any idea what this is for?

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

#9 lore raw
Quoted 9 lines · Daniel J Walsh

I am just adding:

genfscon anon_inodefs / gen_context(system_u:object_r:eventpollfs_t,s0)

Does that look ok?

I also notice in /proc/filesystem that there is a securityfs which we
do not define in policy.
Any idea what this is for?

Calling it eventpollfs might be misleading given that it can also be used for other purposes now. I suppose you could make eventpollfs_t a typealias to a new anon_inodefs_t type.

Greg KH created securityfs in 2005 to avoid having every security module introduce their own pseudo filesystem and mount point. Motivated by AppArmor, I think, and only used by it so far AFAIK. In theory, we should replace selinuxfs with nodes in securityfs, but doing so would be rather disruptive to userspace and provide us with no real gain in functionality.

http://marc.info/?l=git-commits-head&m=112663824224465&w=2

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.