Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1785953ybj; Sun, 22 Sep 2019 11:54:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5V0H7csyvGk4M7gDHt76BzCVbR0FvtiSFP7KgRdvzmXHoNeH1LZcF7IYQ1hyQXBOrsYz3 X-Received: by 2002:a50:cc4d:: with SMTP id n13mr33261868edi.5.1569178455937; Sun, 22 Sep 2019 11:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569178455; cv=none; d=google.com; s=arc-20160816; b=xHqphL/KfJgRGfBRzVcOxLv2nX4wXjR/K5qpj7AFYv+Zr+kxIEQVVZ0HTOV3d1cXZK g4yiyEOe0Hgy3wHZruaoLCDOxLbaHSvrj3UyoHDb1ZQndaI/ywX8Z3B1+MkdXai8gAiD u4SsOikZBNOtalmPAgCAAjEnMrLHfssHmdFIjA4jj2ZPTZAMY136fne58H2fMPUV8CnE NmrYIuj4oTTyKSBunc0st6f1D11Un1IVK+SFA12GMdNdKUS38U8hhgrKhOzg9AawSuBS BGg5DxSSb9iMjg8N8tQTle7/FgV7vWKsGhxxzSGCkh1pYVzisiReI6ZtImWVLLq65t2N uOfw== 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=3qfHDj62HozW8w7YWwj9CkN9/sQfc3fOAZsNubcgArY=; b=ppuTjq3c7z+b4ij5jUYd9rjqd7AuCrbNAyuNrurJ/QNX90qvuk1NtDBw5W1bJ00iD7 vQdvgmUomFPXj9KKbKvxjVw1A2rRbSeJu2rT2Nei2180Suy52R8e+57x77Yy1/Hhr+S+ g1ln2WfNO/m4W+Xm63tQmr88gCpVzzZ4eD74qAu9WDaiSB83ZcPDtQLHkuYqg8Dztxb7 311aZygeo05QHcqEAW+aaxXozFO5s/PHEmCu3NVXXKxd/x9gjocrdxJ935YHxzI+WXr3 5alo14AE+NNF5Rbl7IJApCWjvcXBUq3AzSQTOn1/eTxZZyTVbnINLNG0Ooz+duJuW3vz ljYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZQIGHEoM; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 i40si5275898eda.225.2019.09.22.11.53.51; Sun, 22 Sep 2019 11:54:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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=ZQIGHEoM; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728481AbfITQaM (ORCPT + 99 others); Fri, 20 Sep 2019 12:30:12 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:46297 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728861AbfITQaL (ORCPT ); Fri, 20 Sep 2019 12:30:11 -0400 Received: by mail-lf1-f67.google.com with SMTP id t8so5436156lfc.13 for ; Fri, 20 Sep 2019 09:30:10 -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=3qfHDj62HozW8w7YWwj9CkN9/sQfc3fOAZsNubcgArY=; b=ZQIGHEoM2VE/RUJCyR8wJqhG4SoL3m5ky7t1mnKhLv11uqJxbD6lRJm5k/4ajS8Sdo UMhvXa/MmA5zyCc/ENaP9s79+xZOTrHtnrS7z9ra7Xe2HT/ekZVmC2KO+GbdBvDc35H9 t5l05A8TLonE+2sI7SlSpw7F1/5/t4r9zscBw= 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=3qfHDj62HozW8w7YWwj9CkN9/sQfc3fOAZsNubcgArY=; b=bOA08cnZpTWP5dwnMQqHHYrTR3yxG0YXBunch2D2/IBu9lRDpUKav6wyi7lD6IDt1X zR2R8xFNP0gVAl/KtCGTWoXrPTpzZHyV20cm6F7pfh1Z95utv1ds6gJJqSuxo458GK2D KMEEqcx13syTmaYfvOAI45ABvjmTfScTsDLJFnAw8tVm7Pf9GgMU6T3hCKwb02Hc1kXJ 6fSzHZzUoknPBjjuFoQxXQecsBfb8UFBZ1qMX0llIfK8xVf32qJQVvBWt/H0KUtBcy76 7YTK8rytv0QE+Z9egWsaV4aO84kQRQf5+6qLDzV9PvlyVgeXfDPVT8hT2OHJomi1gxAC 8mZg== X-Gm-Message-State: APjAAAWZ4CcIhcdlrmOatqV92DgDaln2fkz3P8uT4sKrMgW/3vC1UKux U7WhlKG8FENn/is+7pA/4KHuVe1iQ/8= X-Received: by 2002:a19:4a10:: with SMTP id x16mr10024873lfa.126.1568997009378; Fri, 20 Sep 2019 09:30:09 -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 21sm544297ljq.15.2019.09.20.09.30.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Sep 2019 09:30:08 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id v24so7702586ljj.3 for ; Fri, 20 Sep 2019 09:30:07 -0700 (PDT) X-Received: by 2002:a2e:96d3:: with SMTP id d19mr411864ljj.165.1568997007674; Fri, 20 Sep 2019 09:30:07 -0700 (PDT) MIME-Version: 1.0 References: <20190912034421.GA2085@darwi-home-pc> <20190912082530.GA27365@mit.edu> <20190914122500.GA1425@darwi-home-pc> <008f17bc-102b-e762-a17c-e2766d48f515@gmail.com> <20190915052242.GG19710@mit.edu> <20190918211503.GA1808@darwi-home-pc> <20190918211713.GA2225@darwi-home-pc> <20190920134609.GA2113@pc> In-Reply-To: From: Linus Torvalds Date: Fri, 20 Sep 2019 09:29:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC v4 1/1] random: WARN on large getrandom() waits and introduce getrandom2() To: Andy Lutomirski Cc: "Ahmed S. Darwish" , Lennart Poettering , "Theodore Y. Ts'o" , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , Willy Tarreau , Matthew Garrett , lkml , Ext4 Developers List , Linux API , linux-man Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Sep 20, 2019 at 7:34 AM Andy Lutomirski wrote: > > What is this GRND_EXPLICIT thing? Your own email gives the explanation: > Linus, I disagree that blocking while waiting for randomness is an > error. Sometimes you want to generate a key That's *exactly* why GRND_EXPLICIT needs to be done regardless. The keyword there is "Sometimes". But people currently use "getrandom(0)" when they DO NOT want a key, they just want some miscellaneous random numbers for some totally non-security-related reason. And that will continue. Exactly because the people who do not want a key by definition aren't thinking about it very hard. So the interface was very much mis-designed from the get-go. It was designed purely for key people, even though generating keys is by no means the most common reason for wanting a block of "random" numbers. So GRND_EXPLICIT is there very much to make sure people who want true secure keys will say so, and five years from now we will not have the confusion between "Oh, I wasn't thinking about bootup". Because at a minimum, in the near future getrandom(0) will warn about the ambiguity. Or it will use some questionable jitter entropy that some real key users will look at sideways and go "I don't want that". This is an ABI design issue. The old ABI was fundamentally misdesigned and actively encouraged the current situation of mixing secure and insecure callers for that getrandom(0). And it's entirely orthogonal to _any_ actual technical change we will do (like removing the old GRND_RANDOM behavior entirely, which is insane for other reasons and nobody ever wanted or likely used). Linus