Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3536971ybb; Mon, 6 Apr 2020 10:35:27 -0700 (PDT) X-Google-Smtp-Source: APiQypLq2OCL5/pZOl+49eGLsiiFH2kRTLuoXAOXyjCzACNG2S0cZBylbZ3THNREIvX9VM+0lotU X-Received: by 2002:aca:482:: with SMTP id 124mr340474oie.35.1586194526956; Mon, 06 Apr 2020 10:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586194526; cv=none; d=google.com; s=arc-20160816; b=d6MayXVUCJbFPe2eNFc0WKz4K9jt8UDBr/sRYfpp2GEOVLbThEpFV0ieGt/N8trMWh Tnvj2MLHWw4XxaJbbXxVjU3vTOP9xCL7ugrSarwSVUv0HN7CGGLv2+TOUu976eeW95GB dq6uvKDFOk8KsrNMUsmBrbm9TiGLfJ6ujOBKnUhDnaA21ufX85t11R+Ii7E57vgSd+94 UuwXAH17d8ngqUwHhjoF5p2sz1ETxUqlaRwRhp/31UB/KvrPcFdu1OTdFgo++3BoMqGc 3ljp+bctWoC/95k49SZLJtAfob1P5axIp8jgWB0aycFuKt4lXZHT/hMMIoeV0iB3KMsE F2VQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=/Y+ojdhFMF9mwFptJ4Z7V2s4N/uZ8EdyhsK7paPe6qU=; b=PG2XLjvY+m88k5S6XhFdv5A/OjiNqFZ1B9WTKsWJGysleTd7sN0eZFlLdIpHogWCrM vWnLXkPqzPME8svGmApe03m2MI30yULAaaIAG8qZSh/dqYDN5OArv2vJh1RM6C8AGfCE 7E8Sfn3icyO37earnYI3gDSm34qfFwMWa6qvhqyb2zff1SOd09rUpTbL9gsYnSSkC/od TwDcpz4h2mOr9K1fHcLesWiiv88Txw6WsndSQBRr0zkkeUA1n5+Or0nb8bY1GzwJz51T qNz4qizQm6tHzx7OGFKftVASpRvCimc1OWbTYw+fuKXXUoUrKPRC3TNT2R6ZSliuPLkX Z7Cw== 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 64si90048otn.173.2020.04.06.10.35.12; Mon, 06 Apr 2020 10:35:26 -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 S1729885AbgDFRW0 (ORCPT + 99 others); Mon, 6 Apr 2020 13:22:26 -0400 Received: from smtprelay0158.hostedemail.com ([216.40.44.158]:43238 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728945AbgDFRWZ (ORCPT ); Mon, 6 Apr 2020 13:22:25 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 9B0E52C7C; Mon, 6 Apr 2020 17:22:24 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:965:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2692:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4385:4390:4395:5007:6691:7903:10004:10400:10848:11232:11658:11914:12219:12297:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:21627:30054:30060:30074:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:6,LUA_SUMMARY:none X-HE-Tag: page92_6c1d39d59a41b X-Filterd-Recvd-Size: 2829 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Mon, 6 Apr 2020 17:22:22 +0000 (UTC) Message-ID: <7eb36a794df38c885689085618a8a4ff9df3dd2c.camel@perches.com> Subject: Re: [PATCH] mm: Add kvfree_sensitive() for freeing sensitive data objects From: Joe Perches To: Linus Torvalds Cc: David Howells , Waiman Long , Andrew Morton , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , Linux-MM , keyrings@vger.kernel.org, Linux Kernel Mailing List Date: Mon, 06 Apr 2020 10:20:24 -0700 In-Reply-To: References: <20200406023700.1367-1-longman@redhat.com> <319765.1586188840@warthog.procyon.org.uk> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-04-06 at 10:11 -0700, Linus Torvalds wrote: > On Mon, Apr 6, 2020 at 9:44 AM Joe Perches wrote: > > Dubious assertion. Both end up with zeroed memory. > > You don't understand the function. Another dubious assertion. > You ignored the part where the zeroed memory isn't even the _point_. > > Yes, for kzalloc() it is. There the zero is inherent and important. > People very much depend on it, and it's the whole point of that > function. The 'z' is not silent. > > But for kzfree() it really really isn't. There the zeroing is never > going to be seen by anybody wjho does the right thing, and is not > important at all - it's purely a "let's make sure old contents don't > leak". > > The "zero" part is completely immaterial, it could just as well have > been a "memset(0xaa)" instead. or memfill(0xdeadbeef). > And you didn't seem to understand that kzfree() shouldn't use memset() > in the first place, so it's not even using the same operation. > > You really don't seem to get the whole "kzfree() has absolutely > _nothing_ to do with kzalloc() apart from a dubious implementation > details". API function naming symmetry is good. You ignore or don't quote the kzfree/kfree_sensitive too. Yet I don't say _you_ don't understand something.