]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerGuangyu Sun <guangyu.sun@oracle.com>
Wed, 17 Oct 2012 18:24:19 +0000 (11:24 -0700)
commit02493108701ed90f020f61a2def2ea5328bc6ac5
tree0c9a94c27ce9b8e331faa787ef7d3f6c02a4d8e0
parent9f6aa6554a89e59e1fee2cd89c5c8eb4daf3b819
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>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
net/xfrm/xfrm_user.c