All of lore.kernel.org
 help / color / mirror / Atom feed
* Deleting xfrms
@ 2007-02-12 23:39 Joy Latten
  2007-02-13 12:39 ` Stephen Smalley
  2007-02-19 17:37 ` Venkat Yekkirala
  0 siblings, 2 replies; 6+ messages in thread
From: Joy Latten @ 2007-02-12 23:39 UTC (permalink / raw)
  To: jmorris, vyekkirala; +Cc: selinux, redhat-lspp

I was looking at a patch D.Miller posted for xfrm_audit_log()
and could not help but notice that in pfkey_spddelete() and
xfrm_get_policy() we delete policy first and then check to see if we
have permissions to.  Am I missing the original intentions or 
is this incorrect?  Shouldn't it be check the permissions first and then
call xfrm_policy_bysel_ctx()? 

pfkey_spddelete() in af_key.c:

        xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN,
pol->sadb_x_policy_dir-1,
                                   &sel, tmp.security, 1);
        security_xfrm_policy_free(&tmp);

        xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
                       AUDIT_MAC_IPSEC_DELSPD, (xp) ? 1 : 0, xp, NULL);

        if (xp == NULL)
                return -ENOENT;

        err = 0;

        if ((err = security_xfrm_policy_delete(xp)))
                goto out;
        c.seq = hdr->sadb_msg_seq;
        c.pid = hdr->sadb_msg_pid;
        c.event = XFRM_MSG_DELPOLICY;
        km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c);


xfrm_get_policy() in xfrm_user.c is very similar.

Regards,
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] 6+ messages in thread

end of thread, other threads:[~2007-02-19 19:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 23:39 Deleting xfrms Joy Latten
2007-02-13 12:39 ` Stephen Smalley
2007-02-13 12:57   ` Stephen Smalley
2007-02-19 17:37 ` Venkat Yekkirala
2007-02-19 17:47   ` [redhat-lspp] " Eric Paris
2007-02-19 19:10     ` 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.