]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/key/af_key.c
[IPSEC]: xfrm_policy delete security check misplaced
[linux-2.6-omap-h63xx.git] / net / key / af_key.c
index 1c58204d767e6ad460775b13985833dcbf3d5f95..3542435e9d40d1f9c7a978bab6ac7bbc89fb5706 100644 (file)
@@ -2294,14 +2294,12 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
        }
 
        xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN, pol->sadb_x_policy_dir-1,
-                                  &sel, tmp.security, 1);
+                                  &sel, tmp.security, 1, &err);
        security_xfrm_policy_free(&tmp);
 
        if (xp == NULL)
                return -ENOENT;
 
-       err = security_xfrm_policy_delete(xp);
-
        xfrm_audit_log(audit_get_loginuid(current->audit_context), 0,
                       AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL);
 
@@ -2552,7 +2550,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
                return -EINVAL;
 
        xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id,
-                             hdr->sadb_msg_type == SADB_X_SPDDELETE2);
+                             hdr->sadb_msg_type == SADB_X_SPDDELETE2, &err);
        if (xp == NULL)
                return -ENOENT;