Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp569414pxk; Wed, 9 Sep 2020 12:42:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOwRGcLSY05Rk6fW2omnfeZX2N4K9lJuUjaUvnNEWwUlXSFyIf00xAoVKtZyakmby4jPA8 X-Received: by 2002:a05:6402:6c1:: with SMTP id n1mr5879499edy.215.1599680552593; Wed, 09 Sep 2020 12:42:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599680552; cv=none; d=google.com; s=arc-20160816; b=LP41mprL9gz4XNncH7aM9Dd4exVhjgCgXcVmrgwASCD5QJPVDCzI//vxniZLjZsM/C wu34fL84w38ti83X5nMhx0g91wT/zyg3JECzDhuYGQhrKW52BZCDuiAXZzD+cG2VMmc1 pKKq2HvQQI2RWcBzIt0/OzmmpfdjDNe3duFaxG8owN+eE1bNqcHJhasD/PFALTBHgHvc SuG0qJmkbewhdPS8KAMxHrf6ltEuzibDcx8xVHVh2vf7tgnlU+SMGWvflflWLd6kEHM6 T+csX/XoRGaSN2xSCFoj5RPteN5BLHUSWnkyrx5K1O+J9XJk/BYLShrZdAq7ovaZd7xh vG2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=krsC5TlDTzFA7N4jXvevywXfD40E1ld+Bd6bF1uKPo0=; b=hbJoCeK2FrTj1j5M2ZpAtCv/ivIQOAZhPkdwcZrPlNscEhPyN3bINxDDiAL9FB/t25 65lkTdjEkOHlAnhotFdi6UIak+TIIk5WnBTX6mYb3jmoaHPoSXOjlKPiUTImMLWDly2n 4LIibKlOCYDIXshL4dcoRwkNaBKe/fghNsyJolTRGTk4YWehd7uUw9Yy5cZ6FJqxnJBL i2ocafZz4+WAsaDAAiU6Auuqxc4wVkgkoRCnCmsbTI6gBndxljTprPdUk+Hme8skn8/k C8yKQNlQ8XmLUb+spJAg5xlAYatyTUNn3zP/EKBQ/KmN7xe9FAO0IJ2xpEYs/wpWfvIS vzDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=jQApDRLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp12si2309202ejc.155.2020.09.09.12.42.08; Wed, 09 Sep 2020 12:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=jQApDRLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbgIITla (ORCPT + 99 others); Wed, 9 Sep 2020 15:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbgIITl2 (ORCPT ); Wed, 9 Sep 2020 15:41:28 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72DCFC061573 for ; Wed, 9 Sep 2020 12:41:27 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id a65so3410481wme.5 for ; Wed, 09 Sep 2020 12:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=krsC5TlDTzFA7N4jXvevywXfD40E1ld+Bd6bF1uKPo0=; b=jQApDRLWrd0HRK0Vx11RKynsnzL2LCzupHBZ2iu7Sr/BrT11O0VQG0DVMS23c/deNS SC33nesbW4f1JNxaKn/txaZlt7+sZDvy5c1jPtXR3GuwLl62XVBaAp8JIJ7IvWwHGcJV BouAmtu3kK+n8e+lbRp0Be3BIhWYk21qJlKEVPGtjmtg9XutvYprq67RzvKIgtps0WJi CiSjV++ZUc4xOZh6gFp5NMerA0RD0iNSTlHKnqYbfdX0lFcXPw2Z6S2tlD2q8TUfca97 9tKrlCH2FY8kEKw8uZcOmT9ovcZznME5NvT1eGyg294sJtMQDS2XyWkeldcWpZG7jGqo R+wg== 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=krsC5TlDTzFA7N4jXvevywXfD40E1ld+Bd6bF1uKPo0=; b=g6ao/hJ7R/bSJT9gtXH9gWszXZ5fo3CaBce4fxpHjWc7Fx8720SQs6JIwHtPZrOTZ7 EjDtHTBtFaeQi7xVjCB+MaaF8dUhTkMn4Koh5W7UZQHATvaAS73lxPdNDV7b87Fi6ZRg hutvu0DL/3umTZbkfUCV2WeXLQDfaDnh8JTDd9QhMwlePDbaMccLB7RQsr5giMkkJ7Ht QJUBhdGVuoAgiZeYHkz73XVCFG+1x4rjtGFRYccY5hjGZuo7fkHVXk+iyB9Ja52jOa4e gcm+vxRZNHmq9sV7ZE7vPCRvYGoAHaykbqByHMHKO6CG76sLsoE/fdSd8V2BHIeyCK9q hg8A== X-Gm-Message-State: AOAM531zukD8NQ8naG1lGlBCUia3HRJGb/K6fNECdcrUPGgJT3E9tQM8 YeS/f0onqrngOgcD8AG143U= X-Received: by 2002:a1c:800f:: with SMTP id b15mr4806472wmd.114.1599680486179; Wed, 09 Sep 2020 12:41:26 -0700 (PDT) Received: from localhost.localdomain (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id j7sm5402892wrs.11.2020.09.09.12.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 12:41:25 -0700 (PDT) From: Alex Dewar Cc: Alex Dewar , Evgeniy Polyakov , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] w1: Use kfree_sensitive instead of memset+kfree Date: Wed, 9 Sep 2020 20:41:21 +0100 Message-Id: <20200909194122.212486-1-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/w1/w1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index e58c7592008d..4f597b0fd1da 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -71,8 +71,7 @@ static void w1_master_release(struct device *dev) struct w1_master *md = dev_to_w1_master(dev); dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name); - memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master)); - kfree(md); + kfree_sensitive(md); } static void w1_slave_release(struct device *dev) -- 2.28.0