aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnaud Ebalard <arno@natisbad.org>2008-11-03 04:30:23 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-03 04:30:23 -0500
commita1caa32295d67284ecba18cd8db692c7166f0706 (patch)
tree12e0d6f514b665ab3b96c5235c91fe1f4d61a65e /net
parent55c8eb6c8eaa5009eed1557b296da5d4ea9c369a (diff)
XFRM: copy_to_user_kmaddress() reports local address twice
While adding support for MIGRATE/KMADDRESS in strongSwan (as specified in draft-ebalard-mext-pfkey-enhanced-migrate-00), Andreas Steffen noticed that XFRMA_KMADDRESS attribute passed to userland contains the local address twice (remote provides local address instead of remote one). This bug in copy_to_user_kmaddress() affects only key managers that use native XFRM interface (key managers that use PF_KEY are not affected). For the record, the bug was in the initial changeset I posted which added support for KMADDRESS (13c1d18931ebb5cf407cb348ef2cd6284d68902d 'xfrm: MIGRATE enhancements (draft-ebalard-mext-pfkey-enhanced-migrate)'). Signed-off-by: Arnaud Ebalard <arno@natisbad.org> Reported-by: Andreas Steffen <andreas.steffen@strongswan.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/xfrm/xfrm_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 4a8a1abb59ee..a278a6f3b991 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1816,7 +1816,7 @@ static int copy_to_user_kmaddress(struct xfrm_kmaddress *k, struct sk_buff *skb)
1816 uk.family = k->family; 1816 uk.family = k->family;
1817 uk.reserved = k->reserved; 1817 uk.reserved = k->reserved;
1818 memcpy(&uk.local, &k->local, sizeof(uk.local)); 1818 memcpy(&uk.local, &k->local, sizeof(uk.local));
1819 memcpy(&uk.remote, &k->local, sizeof(uk.remote)); 1819 memcpy(&uk.remote, &k->remote, sizeof(uk.remote));
1820 1820
1821 return nla_put(skb, XFRMA_KMADDRESS, sizeof(uk), &uk); 1821 return nla_put(skb, XFRMA_KMADDRESS, sizeof(uk), &uk);
1822} 1822}