diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-31 16:41:26 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-12-18 09:13:38 -0800 |
commit | 123cd635a810bea55c41f09c09e4d6dc1f493876 (patch) | |
tree | eae725837010c32c8b9693d21237c484d0d4bfbe | |
parent | fa5c9e490836ada4cd4bcd97cc44da3696811c7d (diff) |
key: fix setkey(8) policy set breakage
commit 920da6923cf03c8a78fbaffa408f8ab37f6abfc1 upstream.
Steps to reproduce:
#/usr/sbin/setkey -f
flush;
spdflush;
add 192.168.0.42 192.168.0.1 ah 24500 -A hmac-md5 "1234567890123456";
add 192.168.0.42 192.168.0.1 esp 24501 -E 3des-cbc "123456789012123456789012";
spdadd 192.168.0.42 192.168.0.1 any -P out ipsec
esp/transport//require
ah/transport//require;
setkey: invalid keymsg length
Policy dump will bail out with the same message after that.
-recv(4, "\2\16\0\0\32\0\3\0\0\0\0\0\37\r\0\0\3\0\5\0\377 \0\0\2\0\0\0\300\250\0*\0"..., 32768, 0) = 208
+recv(4, "\2\16\0\0\36\0\3\0\0\0\0\0H\t\0\0\3\0\5\0\377 \0\0\2\0\0\0\300\250\0*\0"..., 32768, 0) = 208
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Kadianakis George <desnacked@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/key/af_key.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index b7f5a1c353e..ef3b4d5da65 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -2051,7 +2051,6 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, in req_size += socklen * 2; } else { size -= 2*socklen; - socklen = 0; } rq = (void*)skb_put(skb, req_size); pol->sadb_x_policy_len += req_size/8; |