From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B610EC433DF for ; Mon, 15 Jun 2020 18:41:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 846512071A for ; Mon, 15 Jun 2020 18:41:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LqQUzPlY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="iuyqJ3S+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JZUrw80w"; dkim=neutral (0-bit key) header.d=redhat.com header.i=@redhat.com header.b="LtPJTANz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 846512071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GffI+ZKYR8VxMA13pWd1/tlY7CQEd+653XR0lqTiw9c=; b=LqQUzPlYRmW4Gm3kdv+XAk1tZ gVVtiORKLceVyi8zZ8NKM8eT/zkw/BpcgXb2Blfb2aZjmkzFqzeJBBZacbrFWDv9U6n0BvOgjeFT5 QMsfklkJw/sle+m2+VTkMAymaTh644lJxzj+z7olBy0meYjOIpQk2vK2U53GC1Ykpckn0OiCzBcyk VlNThYLhLkPGl8Z8zrhKSmZ/hFijbNRA0qiKpo4KvIV6YxTiQyKweBdfwCvccoQlumQ5O2dFpe6Ih f8V/NPM5v9u3HEgnmunGb2OjHlC+o64gE3NDAmzp3nPno9JYhhOe3VsIBqC4injE3RaxCp4TEXTRH RYhUKXFdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jku2Z-0002vO-RQ; Mon, 15 Jun 2020 18:41:03 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jku2X-0002tj-Pv for linux-amlogic@bombadil.infradead.org; Mon, 15 Jun 2020 18:41:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=3LdVapGy9WTsAkwpfNEzCTfQe3Pij8/lM5ySXZsHExs=; b=iuyqJ3S+w7X0Ye7qU0Cb7YQnyp PTAI0fJzmkCIKBS32O5Pyo3kck96yib9tmThrisqwMAAhk548nKcyOtFMYk3caoakVwibJCUbW0n/ +CPMqnU9B0b3abRL46DaO9nButePXY8JdiQEh+S6Cb89j16JH/wzX73G5TcCBqEe9TJuJnT0ipobu oQWGid0YRWzD79d3/bwRjR0uBmFJ1cmHiw1dP2nXRy4CSrW1chmCZ3DihanSUtgtaVvJZ/Dse6iQ4 OAgmTXcVlmKWxzix52aqcAbaKhwCv0Q+yl5uvB2Is0ux0AqdDEBa+37l1d7f3BhaMkUSUcxcAul6X pGSfCang==; Received: from us-smtp-2.mimecast.com ([207.211.31.81] helo=us-smtp-delivery-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jku2V-0004Cd-FZ for linux-amlogic@lists.infradead.org; Mon, 15 Jun 2020 18:41:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592246437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3LdVapGy9WTsAkwpfNEzCTfQe3Pij8/lM5ySXZsHExs=; b=JZUrw80wsDeK0bo3tEKQK8XiW9ngmDKg5MFnAeOyBAYl0bASVB+QJjQFV1GJsM7juSSDEX zWSaFZX2UdG6N7HwH1NEKT0XcQDnP7iZ8aY1Tv5Ylz+cF8epg7Ev8QJSHYanngZUDD+NKp g2VWPw/vUn4XzPWpEZ+uPXRfRhU1J0Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592246458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3LdVapGy9WTsAkwpfNEzCTfQe3Pij8/lM5ySXZsHExs=; b=LtPJTANzbHBowo2ItENPFQ9zRO4EIPRVJCvvrHOP9lVjm3OAoLJFx/lc2KSAD2ZVJ6beCW +u4BA1rzyF6mFCifn9pXk2hKcr1DAHD4xucHAXbrdHhIt2+BHol+t1uPrb5aJZZlWBdjU+ hrQoS0EU4IvlQ3MMd01UO8s1DgAd1hU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-n3G_ZfGUONug8wkjJytxqA-1; Mon, 15 Jun 2020 14:40:12 -0400 X-MC-Unique: n3G_ZfGUONug8wkjJytxqA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5F43184D144; Mon, 15 Jun 2020 18:40:06 +0000 (UTC) Received: from llong.remote.csb (ovpn-117-41.rdu2.redhat.com [10.10.117.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3972B5D9CC; Mon, 15 Jun 2020 18:40:00 +0000 (UTC) Subject: Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive() To: Dan Carpenter References: <20200413211550.8307-1-longman@redhat.com> <20200413211550.8307-2-longman@redhat.com> <20200615180753.GJ4151@kadam> From: Waiman Long Organization: Red Hat Message-ID: <9d084be2-29a3-7757-9386-20dbaeb5fc24@redhat.com> Date: Mon, 15 Jun 2020 14:39:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200615180753.GJ4151@kadam> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-cifs@vger.kernel.org, linux-wireless@vger.kernel.org, Jarkko Sakkinen , virtualization@lists.linux-foundation.org, David Howells , linux-mm@kvack.org, linux-sctp@vger.kernel.org, target-devel@vger.kernel.org, kasan-dev@googlegroups.com, cocci@systeme.lip6.fr, devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, x86@kernel.org, James Morris , Matthew Wilcox , linux-stm32@st-md-mailman.stormreply.com, intel-wired-lan@lists.osuosl.org, David Rientjes , "Serge E. Hallyn" , linux-pm@vger.kernel.org, ecryptfs@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-fscrypt@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-integrity@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-nfs@vger.kernel.org, Linus Torvalds , samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-crypto@vger.kernel.org, netdev@vger.kernel.org, Joe Perches , Andrew Morton , linux-wpan@vger.kernel.org, wireguard@lists.zx2c4.com, linux-ppp@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On 6/15/20 2:07 PM, Dan Carpenter wrote: > On Mon, Apr 13, 2020 at 05:15:49PM -0400, Waiman Long wrote: >> diff --git a/mm/slab_common.c b/mm/slab_common.c >> index 23c7500eea7d..c08bc7eb20bd 100644 >> --- a/mm/slab_common.c >> +++ b/mm/slab_common.c >> @@ -1707,17 +1707,17 @@ void *krealloc(const void *p, size_t new_size, gfp_t flags) >> EXPORT_SYMBOL(krealloc); >> >> /** >> - * kzfree - like kfree but zero memory >> + * kfree_sensitive - Clear sensitive information in memory before freeing >> * @p: object to free memory of >> * >> * The memory of the object @p points to is zeroed before freed. >> - * If @p is %NULL, kzfree() does nothing. >> + * If @p is %NULL, kfree_sensitive() does nothing. >> * >> * Note: this function zeroes the whole allocated buffer which can be a good >> * deal bigger than the requested buffer size passed to kmalloc(). So be >> * careful when using this function in performance sensitive code. >> */ >> -void kzfree(const void *p) >> +void kfree_sensitive(const void *p) >> { >> size_t ks; >> void *mem = (void *)p; >> @@ -1725,10 +1725,10 @@ void kzfree(const void *p) >> if (unlikely(ZERO_OR_NULL_PTR(mem))) >> return; >> ks = ksize(mem); >> - memset(mem, 0, ks); >> + memzero_explicit(mem, ks); > ^^^^^^^^^^^^^^^^^^^^^^^^^ > This is an unrelated bug fix. It really needs to be pulled into a > separate patch by itself and back ported to stable kernels. > >> kfree(mem); >> } >> -EXPORT_SYMBOL(kzfree); >> +EXPORT_SYMBOL(kfree_sensitive); >> >> /** >> * ksize - get the actual amount of memory allocated for a given object > regards, > dan carpenter > Thanks for the suggestion. I will break it out and post a version soon. Cheers, Longman _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic