All of lore.kernel.org
 help / color / mirror / Atom feed
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 10/15] IPsec: do not ignore crypto err in ah6 input
Date: Wed, 1 Feb 2017 09:17:52 +0100	[thread overview]
Message-ID: <1485937077-612-11-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1485937077-612-1-git-send-email-steffen.klassert@secunet.com>

From: Gilad Ben-Yossef <gilad@benyossef.com>

ah6 input processing uses the asynchronous hash crypto API which
supplies an error code as part of the operation completion but
the error code was being ignored.

Treat a crypto API error indication as a verification failure.

While a crypto API reported error would almost certainly result
in a memcpy of the digest failing anyway and thus the security
risk seems minor, performing a memory compare on what might be
uninitialized memory is wrong.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/ah6.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 189eb10..dda6035 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -474,6 +474,9 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
 	int hdr_len = skb_network_header_len(skb);
 	int ah_hlen = (ah->hdrlen + 2) << 2;
 
+	if (err)
+		goto out;
+
 	work_iph = AH_SKB_CB(skb)->tmp;
 	auth_data = ah_tmp_auth(work_iph, hdr_len);
 	icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
-- 
1.9.1

  parent reply	other threads:[~2017-02-01  8:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01  8:17 pull request (net-next): ipsec-next 2017-02-01 Steffen Klassert
2017-02-01  8:17 ` [PATCH 01/15] xfrm: trivial typos Steffen Klassert
2017-02-01  8:17 ` [PATCH 02/15] xfrm: state: do not acquire lock in get_mtu helpers Steffen Klassert
2017-02-01  8:17 ` [PATCH 03/15] xfrm: remove unused function Steffen Klassert
2017-02-01  8:17 ` [PATCH 04/15] xfrm: avoid rcu sparse warning Steffen Klassert
2017-02-01  8:17 ` [PATCH 05/15] xfrm: remove xfrm_state_put_afinfo Steffen Klassert
2017-02-01  8:17 ` [PATCH 06/15] xfrm: add and use xfrm_state_afinfo_get_rcu Steffen Klassert
2017-02-01  8:17 ` [PATCH 07/15] xfrm: state: simplify rcu_read_unlock handling in two spots Steffen Klassert
2017-02-01  8:17 ` [PATCH 08/15] xfrm: fix possible null deref in xfrm_init_tempstate Steffen Klassert
2017-02-01  8:17 ` [PATCH 09/15] IPsec: do not ignore crypto err in ah4 input Steffen Klassert
2017-02-01  8:17 ` Steffen Klassert [this message]
2017-02-01  8:17 ` [PATCH 11/15] esp4: Avoid skb_cow_data whenever possible Steffen Klassert
2017-02-01  8:17 ` [PATCH 12/15] esp6: " Steffen Klassert
2017-02-01  8:17 ` [PATCH 13/15] esp: Introduce a helper to setup the trailer Steffen Klassert
2017-02-01  8:17 ` [PATCH 14/15] net: Drop secpath on free after gro merge Steffen Klassert
2017-02-01  8:17 ` [PATCH 15/15] xfrm: Add a dummy network device for napi Steffen Klassert
2017-02-01 16:38 ` pull request (net-next): ipsec-next 2017-02-01 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=1485937077-612-11-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.