]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 10 Feb 2014 21:11:00 +0000 (16:11 -0500)
commitf19e36c418a5e2845b60f96c979f10e46e19418a
tree574ffeda904254a90dec3a33ce7e1724f0139963
parentf667e4c4889827f10f518c3b99f509a7ff602b66
xfrm_user: fix info leak in copy_to_user_tmpl()

commit 1f86840f897717f86d523a13e99a447e6a5d2fa5 upstream.

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.

Cc: Brad Spengler <spender@grsecurity.net>
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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/xfrm/xfrm_user.c