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=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 B39CCC2BA1E for ; Mon, 6 Apr 2020 16:41:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 79DC22498B for ; Mon, 6 Apr 2020 16:41:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="TUDiV7or" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79DC22498B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1561B8E0049; Mon, 6 Apr 2020 12:41:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 106F88E000D; Mon, 6 Apr 2020 12:41:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01C998E0049; Mon, 6 Apr 2020 12:41:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id DE5238E000D for ; Mon, 6 Apr 2020 12:41:53 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 934B6181AEF0B for ; Mon, 6 Apr 2020 16:41:53 +0000 (UTC) X-FDA: 76677996906.03.cry03_2d5458fc35560 X-HE-Tag: cry03_2d5458fc35560 X-Filterd-Recvd-Size: 4700 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 16:41:51 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id r17so35227lff.2 for ; Mon, 06 Apr 2020 09:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Imdp89Sb0+OtYzgCpw3IcqTUqEKq3zexZbxvNKGejvc=; b=TUDiV7orONaSuZs35BQ1mawth0kHmPPUSDaWUc61FjLb/6pFGQBIyQceMCqczVlLuF mQUZ4NQktXHOHP07O9tK8dQGGfgRoZsmJ5GzKHbZpqurg7mKkrY7MYTCAAZGVXJrRCHG ddaqR5NSXTSjop3RFyga75kOxzIQpqbjG4OKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Imdp89Sb0+OtYzgCpw3IcqTUqEKq3zexZbxvNKGejvc=; b=OoVyqrJ0EXe8RgdkDEs1bmg1OobvHrZshNu0UjEiQOeY80Lc985Z51j9IEg51mMoy1 VdVZI15VrBu3ZrtUMRxitkFvRfw5UQR7sDWXMq16hXXWv6/yCVAbWUVZe8kkJ65hih2M IdBJpLHWJLUQA3TNIEIpKNQ4nFhL56T2ol/ZV7qn39eeRogM2WUW/Ode06q/LQWTj5mJ kkglSbYSt+j9h1gvF5eu+G/uFFOU8ApDstWyZQlgzAeseLt/Mkvmv0YQZkEYjciaZ37G F6wmhVsJwuVSCNwLpWZkQ3tJu1BrsykS31jtMe+D+Dz7ofNSrRkNUFpPMcX9YTQmFxMr ksTA== X-Gm-Message-State: AGi0PuYOB2WUc/Cmdpkc1clqSscTFfKc8ivUrfe97ehWdOyu5k88PFX5 RsfLRQP1V0k5NvBLimDJZZte06xbJcw= X-Google-Smtp-Source: APiQypIyr0AEa7S1pAxSpG3FxlB6Vtv3Pvenv9c6FoGM7IZ6zxLQ6UKgHB/DtSpqnV1+pzBKE+apDw== X-Received: by 2002:a05:6512:52c:: with SMTP id o12mr13382952lfc.217.1586191309175; Mon, 06 Apr 2020 09:41:49 -0700 (PDT) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id v3sm11868927lfq.16.2020.04.06.09.41.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 09:41:48 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id r24so400312ljd.4 for ; Mon, 06 Apr 2020 09:41:48 -0700 (PDT) X-Received: by 2002:a2e:8911:: with SMTP id d17mr101988lji.16.1586191307660; Mon, 06 Apr 2020 09:41:47 -0700 (PDT) MIME-Version: 1.0 References: <20200406023700.1367-1-longman@redhat.com> <319765.1586188840@warthog.procyon.org.uk> In-Reply-To: From: Linus Torvalds Date: Mon, 6 Apr 2020 09:41:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: Add kvfree_sensitive() for freeing sensitive data objects To: Joe Perches Cc: David Howells , Waiman Long , Andrew Morton , Jarkko Sakkinen , James Morris , "Serge E. Hallyn" , Linux-MM , keyrings@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 6, 2020 at 9:12 AM Joe Perches wrote: > > While I agree with Linus about the __ prefix, > the z is pretty common and symmetric to all > the zalloc uses. Yes, we have a pattern of 'z' for zero. But the _operation_ isn't symmetric. "kzalloc()" has absolutely _nothing_ to do with "kzfree()". They are not some kind of "opposite symmetric operation". They are totally different. They have absolutely nothing in common. So using the same naming is wrong. They have one implementation detail that looks superficially similar ("zero the area"), but even that superficial similarity is actually completely false. They may both use "memset()", but in one case it is correct and makes sense, and in the other case it's actually a bug waiting to happen, and you really should use that "memzero_explicit()", which is a very very different operation from a normal memzero(). So even the implementation isn't really validly similar, but even if it had been, the _reason_ for doing so is completely different. They simply don't really pair up in any way. Linus