lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Feb 2007 14:48:54 -0800 (PST)
From:	David Miller <>
Subject: Re: xfrm_add_sa_expire return codes

From: "Kent Yoder" <>
Date: Mon, 26 Feb 2007 16:26:41 -0600

>   I was browsing through the xfrm_user.c code and noticed that it
> appears that in xfrm_add_sa_expire, the only possible return codes are
> -ENOENT and -EINVAL.  Was this intentional, or is this a bug?

Please use for kernel networking
discussions, thanks.

Indeed, and the tabbing on the first "err = " assignment should
be a clue that some mistake might have been added.

It looks like the code has been like that from day one, I wonder
how Jamal tested this stuff :-)

I'm going to assume the intended logic, and fix it like this.

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 2567453..924a2fe 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1557,14 +1557,13 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct xfrm_usersa_info *p = &ue->state;
 	x = xfrm_state_lookup(&p->id.daddr, p->id.spi, p->id.proto, p->family);
-		err = -ENOENT;
+	err = -ENOENT;
 	if (x == NULL)
 		return err;
-	err = -EINVAL;
+	err = -EINVAL;
 	if (x->km.state != XFRM_STATE_VALID)
 		goto out;
 	km_state_expired(x, ue->hard, current->pid);
@@ -1574,6 +1573,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 		xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid,
 			       AUDIT_MAC_IPSEC_DELSA, 1, NULL, x);
+	err = 0;
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists