Skip to contentSkip to conversation

automatic type transitions for pts in devfs

DISCUSSION Debian User 4 participants 7 messages Jul 11, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

my patch works with russell's devfsd-se.so disabled. just remove any selinux* file in /etc/devfs/conf.d. i will see if removing only the pts entry in the selinux conf.d file will work.

--
You have received this message because you are subscribed to the selinux 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 3 lines · Debian User

my patch works with russell's devfsd-se.so disabled. just remove any selinux* file in /etc/devfs/conf.d. i will see if removing only the pts entry in the selinux conf.d file will work.

This makes sense. As long as devfsd does not intercept the registration of pts nodes and perform a lookup at that time, your patch should work for labeling pts nodes with transition SIDs.

This is good, as it removes the immediate need to patch devfsd. However, it will still be necessary to patch the kernel devfs code to preserve SIDs on devfs entries when they are evicted from the dcache.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux 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 10 lines · Stephen Smalley
Quoted 5 lines · Debian User

my patch works with russell's devfsd-se.so disabled. just remove any selinux* file in /etc/devfs/conf.d. i will see if removing only the pts entry in the selinux conf.d file will work.

Quoted 8 lines

This makes sense. As long as devfsd does not intercept the registration of pts nodes and perform a lookup at that time, your patch should work for labeling pts nodes with transition SIDs.

This is good, as it removes the immediate need to patch devfsd. However, it will still be necessary to patch the kernel devfs code to preserve SIDs on devfs entries when they are evicted from the dcache.

The system im building from scratch is working perfectly booting in enforcing mode without devfsd. I am fine tuning the policy now.

Im having a problem with my X Window devpts entries. The task sid when X Window creates a pty is xdm_t. What should the proper type be? Ssh works perfectly now in enforcing mode. X stops when I switch to enforcing mode. What are the type transitions when gdm starts X window?

Quoted 7 lines

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux 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 4 lines · Debian User

Im having a problem with my X Window devpts entries. The task sid when X Window creates a pty is xdm_t. What should the proper type be? Ssh works perfectly now in enforcing mode. X stops when I switch to enforcing mode. What are the type transitions when gdm starts X window?

To use an X Display Manager, you need a patched [xgk]dm to set the security context for the user session, as noted in selinux/README. We do not provide a patched [xgk]dm, but I think Russell Coker has a patched kdm and Mark Westerman has a patched gdm. If you are using a patched [xgk]dm, then the pty should be created by a process in the user's domain, not xdm_t, so it should pick up the proper user_devpts_t or sysadm_devpts_t type automatically. At least, that has been my experience.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux 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

dhcpc_t

Hi,
It seems to me that normal user needs to have packet_socket
permission. Of course, I can add directly to macros/user_mmacros.te, but I would like to seek for advice before doing so since packet_socket is relatively powerful.

The message is following,

Jul 11 10:25:26 dhcp2-200 kernel: avc:  denied  { recvfrom } for  pid=693

exe=/sbin/ypbind saddr=206.17.239.200 source=17664 daddr=206.17.239.33 dest=84 netif=eth0 scontext=system_u:system_r:dhcpc_t tcontext=system_u:system_r:ypbind_t tclass=packet_socket

Jul 11 10:25:39 dhcp2-200 kernel: avc:  denied  { recvfrom } for  pid=1807

exe=/usr/bin/gnome-session saddr=206.17.239.200 source=17664 daddr=206.17.239.33 dest=116 netif=eth0 scontext=system_u:system_r:dhcpc_t tcontext=simon:user_r:user_t tclass=packet_socket

Jul 11 10:26:16 dhcp2-200 kernel: avc:  denied  { recvfrom } for  pid=5833

exe=/usr/kerberos/bin/telnet saddr=206.17.239.200 source=17680 daddr=128.97.92.179 dest=53 netif=eth0 scontext=system_u:system_r:dhcpc_t tcontext=simon:sysadm_r:sysadm_t tclass=packet_socket

Thanks in advance,
Simon

--
You have received this message because you are subscribed to the selinux 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

Re: dhcpc_t

Quoted 4 lines · Simon Han

It seems to me that normal user needs to have packet_socket
permission. Of course, I can add directly to macros/user_mmacros.te, but I would like to seek for advice before doing so since packet_socket is relatively powerful.

That wouldn't be a good idea, and it is not necessary for the audit messages you showed. In each message, the denial was caused when the AF_PACKET socket created by dhcpcd received a packet from another domain. Hence, at most, you would add a rule to dhcpc.te permitting dhcpcd to receive packets from any domain (e.g. allow dhcpc_t domain:packet_socket recvfrom;). I'm not even sure whether this is necessary for the operation of dhcpcd; you might be able to just use dontaudit to suppress these messages and silently drop these packets from the dhcpcd socket.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux 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

RE: dhcpc_t

Hello,

I can think of a few kiddie wacker toys that would/could make use of that that allow.

Ed

=> -----Original Message-----
=> From: [email protected] [mailto:[email protected]] On
=> Behalf Of Stephen Smalley
=> Sent: Thursday, July 11, 2002 2:32 PM
=> To: Simon Han
=> Cc: [email protected]
=> Subject: Re: dhcpc_t
=>
=>
=> On Thu, 11 Jul 2002, Simon Han wrote:
=>
=> > It seems to me that normal user needs to have packet_socket
=> > permission. Of course, I can add directly to macros/user_mmacros.te,
=> but
=> > I would like to seek for advice before doing so since packet_socket is
=> > relatively powerful.
=>
=> That wouldn't be a good idea, and it is not necessary for the audit => messages you showed. In each message, the denial was caused when the => AF_PACKET socket created by dhcpcd received a packet from another domain.
=> Hence, at most, you would add a rule to dhcpc.te permitting dhcpcd to => receive packets from any domain (e.g. allow dhcpc_t domain:packet_socket
=> recvfrom;). I'm not even sure whether this is necessary for the => operation
=> of dhcpcd; you might be able to just use dontaudit to suppress these => messages and silently drop these packets from the dhcpcd socket. =>
=> --
=> Stephen D. Smalley, NAI Labs
=> [email protected]

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.