xfrm: Zero padding when dumping algos and encap
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 9 Feb 2023 01:09:52 +0000 (09:09 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 13 Feb 2023 12:38:58 +0000 (13:38 +0100)
commit8222d5910dae08213b6d9d4bc9a7f8502855e624
tree09fc47e6603fffa550f5e0218397a16b34a5dcdf
parent2038cc592811209de20c4e094ca08bfb1e6fbc6c
xfrm: Zero padding when dumping algos and encap

When copying data to user-space we should ensure that only valid
data is copied over.  Padding in structures may be filled with
random (possibly sensitve) data and should never be given directly
to user-space.

This patch fixes the copying of xfrm algorithms and the encap
template in xfrm_user so that padding is zeroed.

Reported-by: syzbot+fa5414772d5c445dac3c@syzkaller.appspotmail.com
Reported-by: Hyunwoo Kim <v4bel@theori.io>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c