* 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
* Re: Problems with login from serial port.
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
0 siblings, 1 reply; 4+ messages in thread
From: Christopher J. PeBenito @ 2007-03-12 1:43 UTC (permalink / raw)
To: Ryan Bradetich; +Cc: selinux
On Sat, 2007-03-10 at 21:25 -0800, Ryan Bradetich wrote:
> I have been making good progress on my customized policy, but I ran
> into a problem that I do not understand.
[cut]
> 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
[cut]
> 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 };
Notice that the scontext is "system_u::" and the tcontext is "root::".
You are hitting the constraint which requires that the SELinux user of
the domain doing the relabeling to match the SELinux user of the object:
constrain dir_file_class_set { create relabelto relabelfrom }
(
u1 == u2
or t1 == can_change_object_identity
);
So you want domain_obj_id_change_exemption(system_t) to pass this
constraint.
--
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150
--
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
* Re: Problems with login from serial port.
2007-03-12 1:43 ` Christopher J. PeBenito
@ 2007-03-12 4:53 ` Eric Paris
2007-03-12 12:45 ` Stephen Smalley
0 siblings, 1 reply; 4+ messages in thread
From: Eric Paris @ 2007-03-12 4:53 UTC (permalink / raw)
To: Christopher J. PeBenito; +Cc: Ryan Bradetich, selinux
On Mon, 2007-03-12 at 01:43 +0000, Christopher J. PeBenito wrote:
> On Sat, 2007-03-10 at 21:25 -0800, Ryan Bradetich wrote:
> > I have been making good progress on my customized policy, but I ran
> > into a problem that I do not understand.
> [cut]
> > 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
> [cut]
> > 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 };
>
> Notice that the scontext is "system_u::" and the tcontext is "root::".
> You are hitting the constraint which requires that the SELinux user of
> the domain doing the relabeling to match the SELinux user of the object:
>
> constrain dir_file_class_set { create relabelto relabelfrom }
> (
> u1 == u2
>
> or t1 == can_change_object_identity
> );
>
> So you want domain_obj_id_change_exemption(system_t) to pass this
> constraint.
Is this something audit2why can or should pick up? Maybe something for
madisen? I think i've hit this in the past as well....
-Eric
--
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
* Re: Problems with login from serial port.
2007-03-12 4:53 ` Eric Paris
@ 2007-03-12 12:45 ` Stephen Smalley
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2007-03-12 12:45 UTC (permalink / raw)
To: Eric Paris; +Cc: Christopher J. PeBenito, Ryan Bradetich, selinux
On Mon, 2007-03-12 at 00:53 -0400, Eric Paris wrote:
> On Mon, 2007-03-12 at 01:43 +0000, Christopher J. PeBenito wrote:
> > On Sat, 2007-03-10 at 21:25 -0800, Ryan Bradetich wrote:
> > > I have been making good progress on my customized policy, but I ran
> > > into a problem that I do not understand.
> > [cut]
> > > 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
> > [cut]
> > > 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 };
> >
> > Notice that the scontext is "system_u::" and the tcontext is "root::".
> > You are hitting the constraint which requires that the SELinux user of
> > the domain doing the relabeling to match the SELinux user of the object:
> >
> > constrain dir_file_class_set { create relabelto relabelfrom }
> > (
> > u1 == u2
> >
> > or t1 == can_change_object_identity
> > );
> >
> > So you want domain_obj_id_change_exemption(system_t) to pass this
> > constraint.
>
> Is this something audit2why can or should pick up? Maybe something for
> madisen? I think i've hit this in the past as well....
audit2why already should report that it violates a constraint, but it
won't presently tell you which constraint was violated or what to do
about it. If Karl succeeds in introducing a policy IR into libsepol
(see his prior RFC), then it will be easier to provide such information
and that functionality can all be rolled into Madison / sepolgen.
--
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 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.