mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
xfrm_user: fix info leak in build_aevent()
The memory reserved to dump the ID of the xfrm state includes a padding
byte in struct xfrm_usersa_id added by the compiler for alignment. To
prevent the heap info leak, memset(0) the sa_id before filling it.
Cc: Jamal Hadi Salim <[email protected]>
Fixes: d51d081d65 ("[IPSEC]: Sync series - user")
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
This commit is contained in:
parent
e3e5fc1698
commit
931e79d7a7
1 changed files with 1 additions and 0 deletions
|
|
@ -1869,6 +1869,7 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct
|
|||
return -EMSGSIZE;
|
||||
|
||||
id = nlmsg_data(nlh);
|
||||
memset(&id->sa_id, 0, sizeof(id->sa_id));
|
||||
memcpy(&id->sa_id.daddr, &x->id.daddr, sizeof(x->id.daddr));
|
||||
id->sa_id.spi = x->id.spi;
|
||||
id->sa_id.family = x->props.family;
|
||||
|
|
|
|||
Loading…
Reference in a new issue