Return-path: Received: from frisell.zx2c4.com ([192.95.5.64]:52679 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbdFJC7W (ORCPT ); Fri, 9 Jun 2017 22:59:22 -0400 From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Cc: "Jason A. Donenfeld" , Anna Schumaker , David Howells , David Safford , "David S. Miller" , Gilad Ben-Yossef , Greg Kroah-Hartman , Gustavo Padovan , "J. Bruce Fields" , Jeff Layton , Johan Hedberg , Johannes Berg , Marcel Holtmann , Mimi Zohar , Trond Myklebust , keyrings@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-nfs@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 0/6] Constant Time Memory Comparisons Are Important Date: Sat, 10 Jun 2017 04:59:06 +0200 Message-Id: <20170610025912.6499-1-Jason@zx2c4.com> (sfid-20170610_050115_037118_F1B49DB8) Sender: linux-wireless-owner@vger.kernel.org List-ID: Whenever you're comparing two MACs, it's important to do this using crypto_memneq instead of memcmp. With memcmp, you leak timing information, which could then be used to iteratively forge a MAC. This is far too basic of a mistake for us to have so pervasively in the year 2017, so let's begin cleaning this stuff up. The following 6 locations were found with some simple regex greps, but I'm sure more lurk below the surface. If you maintain some code or know somebody who maintains some code that deals with MACs, tell them to double check which comparison function they're using. Jason A. Donenfeld (6): sunrpc: use constant time memory comparison for mac net/ipv6: use constant time memory comparison for mac ccree: use constant time memory comparison for macs and tags security/keys: use constant time memory comparison for macs bluetooth/smp: use constant time memory comparison for secret values mac80211/wpa: use constant time memory comparison for MACs Cc: Anna Schumaker Cc: David Howells Cc: David Safford Cc: "David S. Miller" Cc: Gilad Ben-Yossef Cc: Greg Kroah-Hartman Cc: Gustavo Padovan Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Johan Hedberg Cc: Johannes Berg Cc: Marcel Holtmann Cc: Mimi Zohar Cc: Trond Myklebust Cc: keyrings@vger.kernel.org Cc: linux-bluetooth@vger.kernel.org Cc: linux-nfs@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org drivers/staging/ccree/ssi_fips_ll.c | 17 ++++++++------- net/bluetooth/smp.c | 39 ++++++++++++++++++----------------- net/ipv6/seg6_hmac.c | 3 ++- net/mac80211/wpa.c | 9 ++++---- net/sunrpc/auth_gss/gss_krb5_crypto.c | 3 ++- security/keys/trusted.c | 7 ++++--- 6 files changed, 42 insertions(+), 36 deletions(-) -- 2.13.1