xfrm_user: fix info leak in copy_to_user_tmpl()
authorMathias Krause <minipli@googlemail.com>
Wed, 19 Sep 2012 11:33:41 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:38:41 +0000 (05:38 +0900)
commit0c5e37586ef83845acbae1738e693bc97c12d4c3
tree09336b4613715c597972b251a5dd8b8b8fed7a36
parent97f96eab8eb32f3178439f73acca4e286c091435
xfrm_user: fix info leak in copy_to_user_tmpl()

[ Upstream commit 1f86840f897717f86d523a13e99a447e6a5d2fa5 ]

The memory used for the template copy is a local stack variable. As
struct xfrm_user_tmpl contains multiple holes added by the compiler for
alignment, not initializing the memory will lead to leaking stack bytes
to userland. Add an explicit memset(0) to avoid the info leak.

Initial version of the patch by Brad Spengler.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: Brad Spengler <spender@grsecurity.net>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_user.c