From: Mathias Krause <minipli@googlemail.com>
To: Steffen Klassert <steffen.klassert@secunet.com>,
"David S. Miller" <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org, Mathias Krause <minipli@googlemail.com>,
Jamal Hadi Salim <jhs@mojatatu.com>
Subject: [PATCH net 4/4] xfrm_user: fix info leak in build_aevent()
Date: Sat, 26 Aug 2017 17:09:00 +0200 [thread overview]
Message-ID: <1503760140-9095-5-git-send-email-minipli@googlemail.com> (raw)
In-Reply-To: <1503760140-9095-1-git-send-email-minipli@googlemail.com>
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 <jhs@mojatatu.com>
Fixes: d51d081d6504 ("[IPSEC]: Sync series - user")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
net/xfrm/xfrm_user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 2cbdc81610c6..9391ced05259 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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;
--
1.7.10.4
next prev parent reply other threads:[~2017-08-26 15:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-26 15:08 [PATCH net 0/4] xfrm_user info leaks Mathias Krause
2017-08-26 15:08 ` [PATCH net 1/4] xfrm_user: fix info leak in copy_user_offload() Mathias Krause
2017-08-26 15:08 ` [PATCH net 2/4] xfrm_user: fix info leak in xfrm_notify_sa() Mathias Krause
2017-08-26 15:08 ` [PATCH net 3/4] xfrm_user: fix info leak in build_expire() Mathias Krause
2017-08-26 15:09 ` Mathias Krause [this message]
2017-08-26 15:58 ` [PATCH net 0/4] xfrm_user info leaks Joe Perches
2017-08-26 19:56 ` Mathias Krause
2017-08-28 22:52 ` David Miller
2017-08-29 4:43 ` Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1503760140-9095-5-git-send-email-minipli@googlemail.com \
--to=minipli@googlemail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).