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 58FC6C2BA1E for ; Mon, 6 Apr 2020 17:33:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B9C4206C0 for ; Mon, 6 Apr 2020 17:33:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HaLctUUe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B9C4206C0 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 BDDC98E0053; Mon, 6 Apr 2020 13:33:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B8DCF8E000D; Mon, 6 Apr 2020 13:33:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A567E8E0053; Mon, 6 Apr 2020 13:33:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 8BD128E000D for ; Mon, 6 Apr 2020 13:33:58 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4ED8D180AD806 for ; Mon, 6 Apr 2020 17:33:58 +0000 (UTC) X-FDA: 76678128156.20.wish06_3f8318519462e X-HE-Tag: wish06_3f8318519462e X-Filterd-Recvd-Size: 4859 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 17:33:56 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id k21so621077ljh.2 for ; Mon, 06 Apr 2020 10:33:55 -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=crJk+8BSj7iZamojeVRuNeQnx02e+aby3GgDMVtCX+M=; b=HaLctUUehIorhjsFq2+glIghQf2BJmPdCNRSdW6INhtT+CNtKPXSUUdlbD3pPrqHdo wDYu2EbJxV6gfWowAwmLB4BPQOe4BovD3e0D+cJzgLkc9/NAEZMZJ7fAcUfbzHhYkKJa iUPkBc9zIba7IkGAJ4Fs2BcVc+k+RQ3ovwnxk= 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=crJk+8BSj7iZamojeVRuNeQnx02e+aby3GgDMVtCX+M=; b=MD7VbzzoIa4xDNCnm+pfSFmfqXcQ8C3nvLENqMaNtA7Er+ZNyeVbSL7To1kRfBlTW1 RGD124VBB79bZ6UC7/gplly49GkbHz//Gkuo7xmgspHmSL+nmor1pT8geuHMHyyzgtKV hZeG4VUlNaSCegMR24OC3U5r0dPif+FrSn4+Ql1Cq0creozsmTZk01WRT7o93DlL8Kdl WM81oo5C/ll2NPdST3HuPp/AWRU17eUp3+OkBLG5UaES2XTOl8GkEoBsrfi8wkD2Ut/G LXg0+f9z9G2wcTCQpH2MHRM4u84Rw7I0qnyOzu+bYnXviR1eeiepzSFm0A8lmjJP41Q4 UQ0A== X-Gm-Message-State: AGi0Pua9L4kJ03DZUBB+A2mZ1cyW7mvIDBpriN83/3ouFteirpeJ44m+ jjlnrQLFbC+/18Ar1S3MxQ3cjaz/dX4= X-Google-Smtp-Source: APiQypIvdGUHK/Akm1dqPmCccUYK0sPAybNone01WNC4yv1UXg+bqW85T6sHGBEG2xyEeQ6vIEW0UQ== X-Received: by 2002:a2e:b0ee:: with SMTP id h14mr220888ljl.35.1586194433573; Mon, 06 Apr 2020 10:33:53 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id m193sm10171888lfa.39.2020.04.06.10.33.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 10:33:52 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id n17so566854lji.8 for ; Mon, 06 Apr 2020 10:33:52 -0700 (PDT) X-Received: by 2002:a2e:7c1a:: with SMTP id x26mr190977ljc.209.1586194431768; Mon, 06 Apr 2020 10:33:51 -0700 (PDT) MIME-Version: 1.0 References: <20200406023700.1367-1-longman@redhat.com> <319765.1586188840@warthog.procyon.org.uk> <7eb36a794df38c885689085618a8a4ff9df3dd2c.camel@perches.com> In-Reply-To: <7eb36a794df38c885689085618a8a4ff9df3dd2c.camel@perches.com> From: Linus Torvalds Date: Mon, 6 Apr 2020 10:33:35 -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 10:22 AM Joe Perches wrote: > > API function naming symmetry is good. BS. Naming should be symmetric if _use_ is symmetric. But if the use is completely different, then the naming should be completely different too. A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively detrimental, because maybe in the future we really _might_ want to use that "memfill(0xdeadbeef)" or something. The "zero" part of the interface isn't even _relevant_. See? There is no API symmetry. There is only a small and immaterial implementation detail. We don't put an "l" into the kfree/kmalloc names because they internally use a percpu list to manage the allocations, do we? That's a "symmetry" too. But it's an irrelevant implementation detail that makes no sense to the caller. Linus