Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662857

[PATCH 1/6] sunrpc: use constant time memory comparison for mac

From "Jason A. Donenfeld" <Jason@zx2c4.com>
Newsgroups linux.kernel
Subject [PATCH 1/6] sunrpc: use constant time memory comparison for mac
Date 2017-06-10 05:10 +0200
Message-ID <tQEWK-1FJ-9@gated-at.bofh.it> (permalink)
References <tQEN3-1mX-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Otherwise, we enable a MAC forgery via timing attack.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: linux-nfs@vger.kernel.org
Cc: stable@vger.kernel.org
---
 net/sunrpc/auth_gss/gss_krb5_crypto.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index fb39284ec174..12649c9fedab 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -34,6 +34,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#include <crypto/algapi.h>
 #include <crypto/hash.h>
 #include <crypto/skcipher.h>
 #include <linux/err.h>
@@ -927,7 +928,7 @@ gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, struct xdr_buf *buf,
 	if (ret)
 		goto out_err;
 
-	if (memcmp(pkt_hmac, our_hmac, kctx->gk5e->cksumlength) != 0) {
+	if (crypto_memneq(pkt_hmac, our_hmac, kctx->gk5e->cksumlength) != 0) {
 		ret = GSS_S_BAD_SIG;
 		goto out_err;
 	}
-- 
2.13.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Constant Time Memory Comparisons Are Important "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:00 +0200
  [PATCH 3/6] ccree: use constant time memory comparison for macs and tags "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:00 +0200
    Re: [PATCH 3/6] ccree: use constant time memory comparison for macs  and tags Gilad Ben-Yossef <gilad@benyossef.com> - 2017-06-10 09:50 +0200
      Re: [PATCH 3/6] ccree: use constant time memory comparison for macs  and tags "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 13:00 +0200
        Re: [PATCH 3/6] ccree: use constant time memory comparison for macs  and tags Henrique de Moraes Holschuh <hmh@hmh.eng.br> - 2017-06-10 23:50 +0200
  [PATCH 2/6] net/ipv6: use constant time memory comparison for mac "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:10 +0200
  [PATCH 4/6] security/keys: use constant time memory comparison for macs "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:10 +0200
    Re: [kernel-hardening] [PATCH 4/6] security/keys: use constant time  memory comparison for macs James Morris <jmorris@namei.org> - 2017-06-14 11:00 +0200
  [PATCH 1/6] sunrpc: use constant time memory comparison for mac "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:10 +0200
  [PATCH 5/6] bluetooth/smp: use constant time memory comparison for secret values "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:10 +0200
    Re: [PATCH 5/6] bluetooth/smp: use constant time memory comparison  for secret values Marcel Holtmann <marcel@holtmann.org> - 2017-06-10 15:50 +0200
  [PATCH 6/6] mac80211/wpa: use constant time memory comparison for MACs "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-10 05:10 +0200
    Re: [PATCH 6/6] mac80211/wpa: use constant time memory comparison  for MACs Johannes Berg <johannes@sipsolutions.net> - 2017-06-13 10:30 +0200
      Re: [PATCH 6/6] mac80211/wpa: use constant time memory comparison for MACs "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-13 15:30 +0200
  Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Kalle Valo <kvalo@codeaurora.org> - 2017-06-11 10:20 +0200
    Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Kees Cook <keescook@chromium.org> - 2017-06-11 15:40 +0200
      Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Emmanuel Grumbach <egrumbach@gmail.com> - 2017-06-11 22:50 +0200
        Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Emil Lenngren <emil.lenngren@gmail.com> - 2017-06-11 23:40 +0200
          Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Emmanuel Grumbach <egrumbach@gmail.com> - 2017-06-12 07:10 +0200
          Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Arend van Spriel <arend.vanspriel@broadcom.com> - 2017-06-12 09:40 +0200
  Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important Stephan Müller <smueller@chronox.de> - 2017-06-11 23:10 +0200
    Re: [PATCH 0/6] Constant Time Memory Comparisons Are Important "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-11 23:30 +0200
  [PATCH] rsa-pkcs1pad: use constant time memory comparison for MACs "Jason A. Donenfeld" <Jason@zx2c4.com> - 2017-06-11 23:30 +0200

csiph-web