]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm_user: fix info leak in build_expire()
authorMathias Krause <minipli@googlemail.com>
Sat, 26 Aug 2017 15:08:59 +0000 (17:08 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 28 Aug 2017 08:58:02 +0000 (10:58 +0200)
commit6e62ad929fc539b5a66b9ab58540fd4f0a1d40d1
treebf5e774b618ef41b75b83c01e1d120f5c8376c7a
parent52d342139a8cf0c78e43adc02e86b5394509f7cc
xfrm_user: fix info leak in build_expire()

The memory reserved to dump the expired xfrm state includes padding
bytes in struct xfrm_user_expire added by the compiler for alignment. To
prevent the heap info leak, memset(0) the remainder of the struct.
Initializing the whole structure isn't needed as copy_to_user_state()
already takes care of clearing the padding bytes within the 'state'
member.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c