Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp222780pxa; Wed, 26 Aug 2020 23:45:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL07YCfeAS0VRIBjg15sQMAHMQJsykNUK1UZRF85vRAqCeN4v4Y33QVgAwQ55zT+IbBAnp X-Received: by 2002:a50:8f45:: with SMTP id 63mr19014394edy.52.1598510737962; Wed, 26 Aug 2020 23:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598510737; cv=none; d=google.com; s=arc-20160816; b=SNBxIOHkixH/1XdHlUeZQMzimfT67UkxwwZFe1rfb92Jq3gKHbFQzAFyY1d3kWqJhc XXgZrppVjTmW3o0yvZIKUw48emAwZynIH5jVpL0JYRhw5/vbpBzf0gTarBBkVHjpGdHt GUVd8UEjNlhD+oG6bRQqsyRqOCh77el5PKLMGdjOMOEuTkB2usIy7K1OnEpkotBMuD+Y mrrLm/K8sQQ3snKSOs6GJESatcvKwUixid7i5Q2ovz3ZZzKiilLY4x74onWBziKvOWph 70d3KnyMYHjYyP/6lEjhLyZAiCJIJUsLLt30AJ8LL26NA1RKZVgrqidVR9P/PNBGwW9J e/Aw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=f/nPRgHC0iGFykXQ1veAuL/EAakIUq9/Zg/UORe3DVo=; b=ahNhdpHZEQTLQ4MRTJpM23tE9SA8o4dtUCIRdjKna1WaHqGLZfm/556IJFwVVWTW4N 9PLA+UtpSLuoB23yLZ58G7Rk+Stfs/Hl4bXnm7b8686sT/VWRIGcXo7Yw1alSDsXanRA YdS1GoUXvO2hXfzCmugIKAyWpSHcDRLUWweDCP7fB0OsbIUNYz6t5bQxAPibt7e+TyCL lF3G0QK5bYmbMHr7wJUCjVs4ckUEMqugY3WSIInR8dCOA66/3JNo0xcFoORIu+4F6XtU IsKOh+sBLcmYjbwdD+ELHNEMAbog0e1bsyl5/WRVzVfb6/T2u/W7POfG633Rg4QY71n4 72kQ== 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 o9si790737ejr.637.2020.08.26.23.45.14; Wed, 26 Aug 2020 23:45:37 -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 S1727881AbgH0Goz (ORCPT + 99 others); Thu, 27 Aug 2020 02:44:55 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:46838 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726266AbgH0Goy (ORCPT ); Thu, 27 Aug 2020 02:44:54 -0400 Received: by mail-lj1-f195.google.com with SMTP id h19so5137136ljg.13; Wed, 26 Aug 2020 23:44:53 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=f/nPRgHC0iGFykXQ1veAuL/EAakIUq9/Zg/UORe3DVo=; b=KplhNYR/Q7PpC8q3Dd+2RjcTfCDWnusVGHzwlYkOjxB3pJv2RAKyrOjIhaXq5PIARC 6+Ock68WsYxgNgaD/crEy+mwc/72EU+f8Opnhei7Th0qlxehZhHzH+aql+NpWZqmsWrw M3yBLqm70qBRd7YsLEl9aXMMTziNj6EB6m5Fwy+1sEED88In8tKBtgaRHhWjZLLACRHI l5w1kLuQb0eoarwGhSbMV0cyzLkEZbVWQjRfPdt3BYYt3X/6C/rCr1IcMMoFEzQEI+Zu 4svy+qVzg+s/tAsAe0ZwLZA/c8cjTkZHcjBaipWF6qp5Td86OJrcjtvKYmWHJ1ik0RUg 4aQw== X-Gm-Message-State: AOAM533bkU0r1FpnmhiCiWN2Py8MJX+0Tznq9PJ0uIdQYcPAXaMzEgn7 Iy7oqNqnyP/GhivLMe6o34MQdxpUFxE= X-Received: by 2002:a2e:558:: with SMTP id 85mr1670859ljf.293.1598510692176; Wed, 26 Aug 2020 23:44:52 -0700 (PDT) Received: from localhost.localdomain ([213.87.147.111]) by smtp.googlemail.com with ESMTPSA id j17sm282159lfr.32.2020.08.26.23.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 23:44:51 -0700 (PDT) From: Denis Efremov To: linux-crypto@vger.kernel.org Cc: Denis Efremov , Corentin Labbe , Herbert Xu , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] crypto: inside-secure - use kfree_sensitive() Date: Thu, 27 Aug 2020 09:43:59 +0300 Message-Id: <20200827064402.7130-2-efremov@linux.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200827064402.7130-1-efremov@linux.com> References: <20200827064402.7130-1-efremov@linux.com> 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