Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1164613imm; Wed, 1 Aug 2018 11:15:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfT7qzB0lwCq0zWHLzsokA2TOgBIPRO6RfY5vjTp3b5Ua9l4vLoPDaxc1GfmUDkmQlMmVmJ X-Received: by 2002:a17:902:7894:: with SMTP id q20-v6mr26217170pll.3.1533147305890; Wed, 01 Aug 2018 11:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533147305; cv=none; d=google.com; s=arc-20160816; b=Kpsz022qkGAN+1JyoVc9j4zqkIeqacbzX8RpEPT+6gjWhcdgQJInJr/xfyL84kDM33 HEl06uXkOo6MMJ7AjZJ/E6L4rLUCBTGDWmGZk+DGJ4uofspxWxPTP0w1SuCJFPN0bd3c gmxVx4e0QYuzCqadvZlp75TP5qD3VAknOUPEi6Y+wQBWeLg1ZBldbL5t00mg+l/FKBZm 3uyIMPQ9xjnhGohYgq9NO8kf3Er/xcQP+lZOpNFud7BMnpFBJR/eLOc944WiReaIYqyj SRbXA5rXOQi9XwQ/pokj9cG1mzArrjHOYjFI9KOQWlZcJDUDnDpQoGvJDAMh7uekGBKb XXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lofhCr+//shKi5Vm7EEZqe98bfa9d4UGG2UXi4JW4kM=; b=ucPXmTJlnPdxojfEo8yc2aedaWkDotFzdS5UPqoONKvREYBpE6g608ElNTmgT92nZA duiRJNZCdeiCjQAvboTMqWQMV/lZ2mveqLDPgI5RgciLSi4TKHNDF0OUs0aE8Kep/cEB MzFJj2mj70DYcnt36UACbBCci0ZCKFbVB7y07TGD87WRjNjQ1IHt6+fiE7GSlH2Zy8bj i6jdF92qIK/gd00GhHMdUG1hk11oGd9Ho6NACOvklnTK1NB67e6t2NvVTaLgkUB62Bay kcCDllOs8rtoltKh5fEDupzVpaKL8Opy+ydbMH/Fl/VuelEAKoylWCWaFporXPurAT/M BrKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d124-v6si16245937pfg.366.2018.08.01.11.14.51; Wed, 01 Aug 2018 11:15:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405658AbeHATIc (ORCPT + 99 others); Wed, 1 Aug 2018 15:08:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49428 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405275AbeHATIb (ORCPT ); Wed, 1 Aug 2018 15:08:31 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9D8C1CF7; Wed, 1 Aug 2018 17:21:49 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tudor Ambarus , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 201/246] crypto: authenc - dont leak pointers to authenc keys Date: Wed, 1 Aug 2018 18:51:51 +0200 Message-Id: <20180801165021.341456371@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tudor-Dan Ambarus [ Upstream commit ad2fdcdf75d169e7a5aec6c7cb421c0bec8ec711 ] In crypto_authenc_setkey we save pointers to the authenc keys in a local variable of type struct crypto_authenc_keys and we don't zeroize it after use. Fix this and don't leak pointers to the authenc keys. Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- crypto/authenc.c | 1 + 1 file changed, 1 insertion(+) --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -108,6 +108,7 @@ static int crypto_authenc_setkey(struct CRYPTO_TFM_RES_MASK); out: + memzero_explicit(&keys, sizeof(keys)); return err; badkey: