From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
<netdev@vger.kernel.org>
Subject: [PATCH 4/7] xfrm_user: fix info leak in copy_user_offload()
Date: Tue, 29 Aug 2017 12:31:31 +0200 [thread overview]
Message-ID: <1504002694-1931-5-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1504002694-1931-1-git-send-email-steffen.klassert@secunet.com>
From: Mathias Krause <minipli@googlemail.com>
The memory reserved to dump the xfrm offload state includes padding
bytes of struct xfrm_user_offload added by the compiler for alignment.
Add an explicit memset(0) before filling the buffer to avoid the heap
info leak.
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 2be4c6a..3259555 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -796,7 +796,7 @@ static int copy_user_offload(struct xfrm_state_offload *xso, struct sk_buff *skb
return -EMSGSIZE;
xuo = nla_data(attr);
-
+ memset(xuo, 0, sizeof(*xuo));
xuo->ifindex = xso->dev->ifindex;
xuo->flags = xso->flags;
--
2.7.4
next prev parent reply other threads:[~2017-08-29 10:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 10:31 pull request (net): ipsec 2017-08-29 Steffen Klassert
2017-08-29 10:31 ` [PATCH 1/7] net: xfrm: don't double-hold dst when sk_policy in use Steffen Klassert
2017-08-29 10:31 ` [PATCH 2/7] esp: Fix locking on page fragment allocation Steffen Klassert
2017-08-29 10:31 ` [PATCH 3/7] esp: Fix skb tailroom calculation Steffen Klassert
2017-08-29 10:31 ` Steffen Klassert [this message]
2017-08-29 10:31 ` [PATCH 5/7] xfrm_user: fix info leak in xfrm_notify_sa() Steffen Klassert
2017-08-29 10:31 ` [PATCH 6/7] xfrm_user: fix info leak in build_expire() Steffen Klassert
2017-08-29 10:31 ` [PATCH 7/7] xfrm_user: fix info leak in build_aevent() Steffen Klassert
2017-08-29 16:37 ` pull request (net): ipsec 2017-08-29 David Miller
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=1504002694-1931-5-git-send-email-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/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