Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3479444ybb; Mon, 6 Apr 2020 09:42:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKmga9DaVm0o0Mv6iLOsiAXeZRjt3c15Koa65Edz2PVO/konveGQBFKDGd3fvBn0lK8tySy X-Received: by 2002:aca:1c13:: with SMTP id c19mr29885oic.178.1586191364521; Mon, 06 Apr 2020 09:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586191364; cv=none; d=google.com; s=arc-20160816; b=Pyf+8/sAGchzDXKzKBEj16kRF0SpwXWolqmb/fa+Wks5hK7pXwL/RMCfXeLmw8fac5 x+ckcCPAk5KAswlKZUahYIwjWp76dJuyfnH5MIeZB9fa1uJviTuUfyPWYlsLwEti97u+ U/dUk7x7w/aDwY6WZUGSiuKl/WafrL4v736a1DfzColylyohnFwya82IHMbxCZEab+RI nt/qA5vt9RA7ZaItvRk+dyGd43xT7BGFyzCvznR9Ld1qP46jaTsKux2pubwovKiVlsRu yxs+4m7lOXrYO2plJoq7zKJY2Rp4Gv3I82xa3vGM7s2c2znlyX/8gp3oeHwULyViuGv9 kZNQ== 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=Imdp89Sb0+OtYzgCpw3IcqTUqEKq3zexZbxvNKGejvc=; b=HjEakwvJ7/pDuWni0DXQVIZmiELZM31qQbRtxZ7b+EjbWATP/UiGupPB0230yG6g9F lQoWsX3z8iBSqkYfFjF6a6pPm63E1dYczyq4UqcBoXnmUFboxkOMvoOArN6T3ZgRo5Ch vR9E5o3kRx4czJhJojOGf2tZKa0A/D6JyBx8r3/Jwq4uFPz1G/d5JJ8oDIPvgHkmFI1D 6PHneVp/6XlYMx8p/TVTVEm2wb98WbSOTa9eA3mDqk4+lu0P7DVNjs9YlFaH58bNnsie N7IQYZrvJnFCoi89O9HjSH3SRldO26s0/q/fShMX5rqooNDHHSuF0yGQcf1WhTQDQ2J4 nqUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TUDiV7or; 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 e22si20990oob.87.2020.04.06.09.42.32; Mon, 06 Apr 2020 09:42:44 -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=TUDiV7or; 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 S1729632AbgDFQlw (ORCPT + 99 others); Mon, 6 Apr 2020 12:41:52 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37076 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729616AbgDFQlv (ORCPT ); Mon, 6 Apr 2020 12:41:51 -0400 Received: by mail-lj1-f193.google.com with SMTP id r24so400426ljd.4 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=EQIwO9zkXOCAUqOF7OGLYbSfYB51yr7PYHgmNSNx2ezNcVBx4O1rIGFOcUXAUQcOpX TeKLMxgb/1AYsOfeGUmGwYy/tkHDNHAuhyBgDjaWBQQRfODT5Vz+rjqzxVVeIAOigxww 6wPilhKOnJdcRi4pjrhkxTPK0tDmKO070O/gdkJjkXbkSRm/sywJ+oL6MOPua8KTPNEY cuxarLp7cgQ2+YvWpZraE0wJ+7fPFs1t3J3fRNCW66Mgtc2un9+o3oACw1Z7ApCvXyjk 8C5uZZMKpXH+p1fLtyXY/ILwgqJz6VnsSpIVW+mJtv8QnjSHhvFnZX4xGd6+tfkX0gj2 ZhDQ== X-Gm-Message-State: AGi0PuaCwEB/3tC5L6jV79GVaXkkxx3Z36ZYXwiyRvEkdQEEWOybJ5pU yJ77F/H2A4l8K+hyOLdgc4CXRaze678= X-Received: by 2002:a2e:3a16:: with SMTP id h22mr62635lja.81.1586191309130; Mon, 06 Apr 2020 09:41:49 -0700 (PDT) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id o4sm11713936lfl.62.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-f174.google.com with SMTP id t17so335047ljc.12 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" 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 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