* [Fwd: How should we handle polmatch avcs?]
@ 2006-09-25 15:23 Daniel J Walsh
0 siblings, 0 replies; 2+ messages in thread
From: Daniel J Walsh @ 2006-09-25 15:23 UTC (permalink / raw)
To: Joy Latten, SE Linux, redhat-lspp
Seems like we have a problem with current OpenSwan/IPSec stuff.
I believe that some of these are bugs in the implementation.
-------- Original Message --------
Subject: How should we handle polmatch avcs?
Date: Sat, 23 Sep 2006 06:59:30 -0400
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>, "Christopher J. PeBenito"
<cpebenito@tresys.com>
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207304
allow initrc_t self:association polmatch;
allow unlabeled_t initrc_t:association polmatch;
allow unlabeled_t self:association polmatch;
--
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] 2+ messages in thread
* Re: [Fwd: How should we handle polmatch avcs?]
@ 2006-09-25 18:52 Joy Latten
0 siblings, 0 replies; 2+ messages in thread
From: Joy Latten @ 2006-09-25 18:52 UTC (permalink / raw)
To: dwalsh, latten, redhat-lspp, selinux
>Seems like we have a problem with current OpenSwan/IPSec stuff.
>
>I believe that some of these are bugs in the implementation.
>
>-------- Original Message --------
>Subject: How should we handle polmatch avcs?
>Date: Sat, 23 Sep 2006 06:59:30 -0400
>From: Daniel J Walsh <dwalsh@redhat.com>
>To: Stephen Smalley <sds@tycho.nsa.gov>, "Christopher J. PeBenito"
><cpebenito@tresys.com>
>
>
>
>https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=207304
>
>allow initrc_t self:association polmatch;
>allow unlabeled_t initrc_t:association polmatch;
>allow unlabeled_t self:association polmatch;
I have run across the last of the 3 rules, and believe we do need it.
The first 2, I have not come across yet.
The last rule will definitely be needed by selinux_xfrm_state_pol_flow_match()
when sending unlabeled packets. Because, avc_has_perm() takes SA sid and
policy sid to check. And when sending unlabeled packets, these will
both be unlabeled_t.
I am not very familiar with openswan or pluto. My guess is they
do not contain modifications to use labeled ipsec. Thus this is
running just plain non-labeled ipsec.
The first two rules, I am not sure I understand where they are being
required. Could not be the hook mentioned above, because in the case
of unlabeled packets, policy and SA sids will always be unlabeled_t.
The only other hook that uses polmatch is selinux_xfrm_policy_lookup()
and avc_has_perm() checks flow sid and policy sid. Again, in the case
of unlabeled packets, the policy sid should always be unlabeled_t. So,
target will always be unlabeled_t... maybe some sort of transition happens?
I added "polmatch" to kernel_sendrecv_unlabeled_association interface
in kernel.if. Originally, the check in selinux_xfrm_policy_lookup()
was for association:sendto recvfrom. This was changed with the
introduction of the latest set of patches to labeled ipsec that
introduced, polmatch. Thus I figured we needed to add "polmatch"
here too.
Also, selinux_xfrm_policy_lookup() will get called when an app wants
to send a packet. It does an avc_has_perm()
using flow sid as source and policy sid as target. I noticed that the
flow_sid must sometimes be assigned the socket sid, because for a ping,
my source sid aka flow_sid is ping_t. avc_has_perm() appears to check
if ping_t can access unlabeled_t. Thus, apps sending unlabeled
ipsec packets, will call selinux_xfrm_policy_lookup... so it seem
easier to just add polmatch in this interface. This interface gets called
by corenet_non_ipsec_sendrecv in corenetwork.if. I noticed most
apps/daemons and init call corenet_non_ipsec_sendrecv.
Joy
--
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] 2+ messages in thread
end of thread, other threads:[~2006-09-25 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-25 15:23 [Fwd: How should we handle polmatch avcs?] Daniel J Walsh
-- strict thread matches above, loose matches on Subject: below --
2006-09-25 18:52 Joy Latten
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.