All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems with login from serial port.
@ 2007-03-11  5:25 Ryan Bradetich
  2007-03-12  1:43 ` Christopher J. PeBenito
  0 siblings, 1 reply; 4+ messages in thread
From: Ryan Bradetich @ 2007-03-11  5:25 UTC (permalink / raw)
  To: selinux

Hello all,

I have been making good progress on my customized policy, but I ran
into a problem that I do not understand.   I changed the type on the
/dev/ttyS0 device file because my larger security goal is to require
user access to the system_t domain to come from the ttyS0 serial port.
 Ignoring the larger security goal for now, I am just trying to
address the avc messages when I login to the system on the ttyS0
serial port.

Here are the relevant parts of my policy:

# ls -lZ /bin/busybox
-r-xr-xr-x    1 system_u:object_r:system_exec_t     259664 Feb 27
00:29 /bin/busybox

# ls -lZ /bin/login
lrwxrwxrwx    1 system_u:object_r:system_t           7 Feb 27 00:43
/bin/login -> busybox

# ls -lZ /dev/ttyS0
crw-------    1 root:object_r:sysadm_tty_device_t    4,  64 Mar 11
04:39 /dev/ttyS0


Here are the avc message I get when I login in permissive mode:

audit(1173587017.702:3): avc:  denied  { relabelfrom } for  pid=199
comm="login" name="ttyS0" dev=hda1 ino=31387
scontext=system_u:system_r:system_t
tcontext=root:object_r:sysadm_tty_device_t tclass=chr_file

audit(1173587017.702:3): avc:  denied  { relabelto } for  pid=199
comm="login" name="ttyS0" dev=hda1 ino=31387
scontext=system_u:system_r:system_t
tcontext=root:object_r:sysadm_tty_device_t tclass=chr_file

audit(1173587017.702:3): arch=40000003 syscall=226 success=yes exit=0
a0=808b040 a1=b7f9f2c7 a2=8090638 a3=22 items=0 ppid=1 pid=199
auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sg
id=0 fsgid=0 tty=ttyS0 comm="login" exe="/bin/busybox"
subj=system_u:system_r:system_t key=(null)



I have the following rule in my policy file (I thought this rule will
have addressed the avc  message):

allow system_t sysadm_tty_device_t:chr_file { read write ioctl getattr
setattr relabelto relabelfrom };


Running the avc messages through audit2allow does not produce anything
I do not already have:

# audit2allow < /root/dmesg
allow system_t sysadm_tty_device_t:chr_file { relabelfrom relabelto };


It seems that I am missing an avc message, but I can not figure out
what it would be.  I have reviewed my policy and removed all the
dontaudit messages.   I am also in the process of reviewing the
standard refpolicy modules that deal with login and serial ports.

I just really curious what I am missing and why when I apply the
suggested fixes to allow the action, I am still receiving the avc
messages.   Any thoughts or ideas on how to solve this would be
greatly appreciated!

Thanks,

- Ryan

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-12 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-11  5:25 Problems with login from serial port Ryan Bradetich
2007-03-12  1:43 ` Christopher J. PeBenito
2007-03-12  4:53   ` Eric Paris
2007-03-12 12:45     ` Stephen Smalley

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.