summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c87308)
raw | patch | inline | side by side (parent: 4c87308)
author | Mathias Krause <minipli@googlemail.com> | |
Wed, 19 Sep 2012 11:33:39 +0000 (11:33 +0000) | ||
committer | David S. Miller <davem@davemloft.net> | |
Thu, 20 Sep 2012 22:08:39 +0000 (18:08 -0400) |
The memory reserved to dump the xfrm state includes the padding bytes of
struct xfrm_usersa_info added by the compiler for alignment (7 for
amd64, 3 for i386). Add an explicit memset(0) before filling the buffer
to avoid the info leak.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
struct xfrm_usersa_info added by the compiler for alignment (7 for
amd64, 3 for i386). Add an explicit memset(0) before filling the buffer
to avoid the info leak.
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_user.c | patch | blob | history |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 40dd50d6c4cc31efec38b9525f88056269df9a4a..d585459dc8bb541f6c6e115dd585fbd04bf6ded6 100644 (file)
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p)
{
+ memset(p, 0, sizeof(*p));
memcpy(&p->id, &x->id, sizeof(p->id));
memcpy(&p->sel, &x->sel, sizeof(p->sel));
memcpy(&p->lft, &x->lft, sizeof(p->lft));