Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3546731ybb; Mon, 6 Apr 2020 10:47:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLlwkL3bTv+WdjWMm3tfyOTN98AS0Mbe7xIOpONioTsocX4FH2oVkNKRG54Jel44BDwO0Z5 X-Received: by 2002:a9d:412:: with SMTP id 18mr200297otc.134.1586195243674; Mon, 06 Apr 2020 10:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586195243; cv=none; d=google.com; s=arc-20160816; b=eknSBSC8CHaY9wefFHYQ0smRoz0DWrdFu7NtDz8uo0jcnN7fpSh+Huj0esOe6FmE50 PNSR8kjA+lAlvPM2cS2FtkFncmuyKxgl7kL5LITcoaUah+fjhdH6funwyl3m8aGINaDG tjmnfPR5e/X2H2EXn0/+FMF3/ZH+b2WXmxreOCM5DBH6pvdcSXDGduWkoDd8h2+LOXYm jPI45SEfZ9LTJ8jrRH3uc6u0DC9e/5hg6vVau2ADHnVax4qam9sNL4BLhC5nKFpJpXel N+TS7RgR7FaA30wdzYnAeAHooZMIu1asptpXMBeHzenlYx/iMgeD6sZ8wwQqp+hsohNK UyKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=crJk+8BSj7iZamojeVRuNeQnx02e+aby3GgDMVtCX+M=; b=obJorz2+Nwx45BbQW/VBL4cY7VmTBPssNJXvlHnWZonIBi4uoQ/FDgPBJhH13WqJyI QVe6fO3VVZuJKHUT7PwIPSnKzvPdOycURjIlAPUQWr7PksMFg04H1qWdatNNUI3Jghbx mn5I13SSKNc+/v/DsJPMs519xGo1HyjlY+zk56tbswQnMHdkmLMeQwuj0H0YELMzSFgk X2F95Hn22BatWTz0PoVsqduO+XtSq9pOgekZve/rAXofrYyteBRJ7pNAmjTw86dDzxIG qaxnsH+owU0h4mHxaNXukt9FlHKvlkw5bFmnHT0hRoeBc3xT/l9MF4xsOeKCPZ6jJTgD heyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HaLctUUe; 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 w188si7402661oig.183.2020.04.06.10.47.11; Mon, 06 Apr 2020 10:47:23 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=HaLctUUe; 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 S1729140AbgDFRd4 (ORCPT + 99 others); Mon, 6 Apr 2020 13:33:56 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33367 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgDFRd4 (ORCPT ); Mon, 6 Apr 2020 13:33:56 -0400 Received: by mail-lf1-f66.google.com with SMTP id h6so189841lfc.0 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=GRvAErOzJJphWODiqVHPtzSadwO0/5kuVXHny1ts1elSUbMjRWwW6r5G5kKx1q4jf3 T1Lr54Z64RcyGDoL2iGA1sXmmC3ujqfQAsFF7wMkAvuMWwjXo0X0MttiiOeTn4wcP5Ff UiRc5ijU5qt/jPmAM2/htZ48fjCIXCY3OpoEF3k67BbNBdGY/yjf1wBPzEm/DB1i+vaH Ny+IEEhXkn1vMl/3r9E9Ngp2mC9nkMIG8o0o3lH+UgGwKEo0Ukjj5kuMiIPzGArAJbKj j4uOYAaCi5oEWyWRHmY2TLENWtbqocvqNm0tyO4hPhcKaGoU4IBlKtEOkA2FobymAGre h4Rw== X-Gm-Message-State: AGi0Pub/OvU0Oj3iNuMWfuQlE0Ib3kfvta0F5aIzA6zXFQj4w8hCGLMY /+E82WyauAlom+z2q60ILKj8f/UcbwY= X-Received: by 2002:a19:c64b:: with SMTP id w72mr13817427lff.82.1586194433675; Mon, 06 Apr 2020 10:33:53 -0700 (PDT) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id l13sm10349613ljc.84.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-f169.google.com with SMTP id b1so607975ljp.3 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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