xfrm_user: fix info leak in copy_to_user_policy()
authorMathias Krause <minipli@googlemail.com>
Wed, 19 Sep 2012 11:33:40 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:28:04 +0000 (05:28 +0900)
commita601da719c73cedba80c788719594990e30a972f
tree01a60f33128e680dece2bbaf2cd860b4bd2d265e
parent2f21f42628061faa605c76c53449a325597137a7
xfrm_user: fix info leak in copy_to_user_policy()

[ Upstream commit 7b789836f434c87168eab067cfbed1ec4783dffd ]

The memory reserved to dump the xfrm policy includes multiple padding
bytes added by the compiler for alignment (padding bytes in struct
xfrm_selector and struct xfrm_userpolicy_info). Add an explicit
memset(0) before filling the buffer to avoid the heap 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_user.c