Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp113150pxa; Wed, 26 Aug 2020 06:16:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw95arbbxWR+pDM/2Dop/7SbJyC9sh0iGlBu4TonfRJafwJVxZFhfHFXG1odF2ByeUD8lkY X-Received: by 2002:a17:906:f848:: with SMTP id ks8mr1083996ejb.5.1598447768416; Wed, 26 Aug 2020 06:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598447768; cv=none; d=google.com; s=arc-20160816; b=nzuLlK1MGX/Fji1PiksU4ZKCBiklKskMS+n+3LA/+RiOEpWJxj4bSTIKdE+1X1Srd+ pg/JQFRUZVTx335VOCiPY+jF5IK+lNYMCw8gyspVUW2zjUspwsLPPj4v8dI74UY3Fplm DrFVF7o2zqj6eEoA5ugEfENTsRpman+QRPQwyqSFB1MW0HaJtk+mq66CSsbxZx8yydel ntcIsvMOg6kELTCD0XxLVqmn79WE14wjRi3T9W1jXiNK7tRA6fxEJRbEE5LJmXuWM8TJ 3oTIqGozbPKimyvSw4560ELN+w1r0W1Dlo2Ew//1nHg+WfedZJdzmCbJqnLcETM9kf7t SgrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=f/nPRgHC0iGFykXQ1veAuL/EAakIUq9/Zg/UORe3DVo=; b=MvM1DZxqaoE4snMXOAlx8CdJniQfgP+NjofYad6OUJ3LHM4YtOH4DxjWY95Wl0GTFK C3NJYNocQSnaoJ617U5ditqADQmOzydkpByxwXWDblFH0TSjbH2Xta1DHOvYkfOFjopc sOWJDBpMD0yFLIbw8jrsenXAveb8XXYkv9DJaL6PiKkq5EtuDQckWcXlwgZKfhtf06pb B4UrvJtUMNJtV8jccog0sGTWPklQ166AnGOh05R7Gn3jHE+36jyMpIKHCeVy9NAa5+AP 5zKKY/flsqASkI7ZdUXVg/lYWf+efpCnBFsPGQsSJKN4QvQDJdvhsJdq63JIkF4a08nh 3P0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si1668542ejd.344.2020.08.26.06.15.39; Wed, 26 Aug 2020 06:16:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730131AbgHZNP3 (ORCPT + 99 others); Wed, 26 Aug 2020 09:15:29 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44303 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729177AbgHZNP2 (ORCPT ); Wed, 26 Aug 2020 09:15:28 -0400 Received: by mail-lj1-f194.google.com with SMTP id g6so2278339ljn.11; Wed, 26 Aug 2020 06:15:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f/nPRgHC0iGFykXQ1veAuL/EAakIUq9/Zg/UORe3DVo=; b=ZfgII+nubV6VFC5S9VlSTQf0+5gEAae6S0Kq3K8S67Fa5yzY8IwcMpbvex/dVNqhyx EKwrEPL6EI30MZZRfQ2844SAZ2xNFU9eL1WP80sOEBZTrDXdrOZHj3IJP6m/7+uu/t3+ MlJqAf2yoh26MTg25Szc5EPvNAxhxqTLyTC3fRqghyDQr7BjT/vOQzLUnBimfXfwAnd1 xCXQ2whsdVCI9XTwWtwJbdO6f21Ja2Hv3HhUFohXcyKObXn+SjdljIhfGN5wsPZJkMLW Lj1ZXZJPgf3lMSZkKly1wIAFboYUzeaHn5v7uURyZ5nsO4tthzjhwCJjjHbsXJMyyqon a9WQ== X-Gm-Message-State: AOAM532YSg6DRtW70bxkccC1vb0SAyk/ERqpVGdwu+LBjJv4jatkdad5 2mp1isPuR094lzE3Cbo+SUvGSr7tUJA= X-Received: by 2002:a2e:85a:: with SMTP id g26mr7096722ljd.60.1598447726234; Wed, 26 Aug 2020 06:15:26 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id r11sm503320ljk.46.2020.08.26.06.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 06:15:25 -0700 (PDT) From: Denis Efremov To: linux-crypto@vger.kernel.org Cc: Denis Efremov , Antoine Tenart , Herbert Xu , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH] crypto: inside-secure - use kfree_sensitive() Date: Wed, 26 Aug 2020 16:15:14 +0300 Message-Id: <20200826131515.397667-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use kfree_sensitive() instead of open-coding it. Signed-off-by: Denis Efremov --- drivers/crypto/inside-secure/safexcel_hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypto/inside-secure/safexcel_hash.c index 16a467969d8e..5ffdc1cd5847 100644 --- a/drivers/crypto/inside-secure/safexcel_hash.c +++ b/drivers/crypto/inside-secure/safexcel_hash.c @@ -1082,8 +1082,7 @@ static int safexcel_hmac_init_pad(struct ahash_request *areq, } /* Avoid leaking */ - memzero_explicit(keydup, keylen); - kfree(keydup); + kfree_sensitive(keydup); if (ret) return ret; -- 2.26.2