Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1800825ybj; Sun, 22 Sep 2019 12:12:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmw//t0FTc3IesDsgjvoncYE7OzdIfZ+wo6zST5Yby34AW8d0kWcmndGFBQcQBXk6xtYTs X-Received: by 2002:aa7:d803:: with SMTP id v3mr33348146edq.146.1569179576181; Sun, 22 Sep 2019 12:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569179576; cv=none; d=google.com; s=arc-20160816; b=SehyVzL2TGA2vg5hPCNCCgzIqPinG35JTdbNRg1MagDjggU5Ve74cG7QosXPhcya9N wHifE8MNDbJ2kqM0Z6QZnqHZVf2iWaUtMK20NaCoVMtTvzMXcYw/M+umopilH6jpRHFn F010BZysmMpxNH92+NvGMDYZfiGwx4sPWccaGjgck635szkrVniLpuK+6KqTLJsP+YAw f5xECzPgJDxdI4a0BUJNuPO+wcI4FSd1Hn4CLdxGy9/4XEqLNWjt6YPfBlvjtTyMKjQq vkh8oSVF3RIVp6VOuEcCDCR71mp1VwD6pZYTi//aNmAXfsY3LicXltT62gRAHOPTE1Nc O+rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LEh0f+5so0mRvqQgelJOE9nlhEFWXhmCY7P5lBUEBzE=; b=iWumm1X5pFGGUxruKyZ9k1XseY8d62fUPRzuseCZ1chApEUhx0KxO5PwpKadhapvjR aUQwwpEfogXD61HJda2KkRC4lWA0Ya4vhu8SPrtzdGr2n3tbSD/cQ74CrNY1JibWU0NY ftsu5qDCAK6IukF3Ao4hz3DIoNLgHM6nsGVi9vIiONlLbo3Sxw8rOTf0fLpr7ZytoQ2S pBlntEOIWMMQg8y/cOpSNJ0lEldRW1xkmvvb9gd/31P9Gcxnk5Y3QLegHWf+aDqkd4Y/ 6oSVXCNrexhIBjLp/ysOb0dPV4hH//9sQg7pr4zbgz8sGQVtj8xv+RSUd4q+wXajTN1t pgCg== ARC-Authentication-Results: i=1; mx.google.com; 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 h14si6112148edk.315.2019.09.22.12.12.31; Sun, 22 Sep 2019 12:12:56 -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; 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 S2405181AbfIUDGC (ORCPT + 99 others); Fri, 20 Sep 2019 23:06:02 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:49432 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729387AbfIUDGC (ORCPT ); Fri, 20 Sep 2019 23:06:02 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id x8L35l8v002407; Sat, 21 Sep 2019 05:05:47 +0200 Date: Sat, 21 Sep 2019 05:05:47 +0200 From: Willy Tarreau To: Andy Lutomirski Cc: Linus Torvalds , "Ahmed S. Darwish" , Lennart Poettering , "Theodore Y. Ts'o" , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , Matthew Garrett , lkml , Ext4 Developers List , Linux API , linux-man Subject: Re: [PATCH RFC v4 1/1] random: WARN on large getrandom() waits and introduce getrandom2() Message-ID: <20190921030547.GF1889@1wt.eu> References: <20190920134609.GA2113@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) 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 04:30:20PM -0700, Andy Lutomirski wrote: > So I think that just improving the > getrandom()-is-blocking-on-x86-and-arm behavior, adding GRND_INSECURE > and GRND_SECURE_BLOCKING, and adding the warning if 0 is passed is > good enough. I think so as well. Anyway, keep in mind that *with a sane API*, userland can improve very quickly (faster than kernel deployments in field). But userland developers need reliable and testable support for features. If it's enough to do #ifndef GRND_xxx/#define GRND_xxx and call getrandom() with these flags to detect support, it's basically 5 reliable lines of code to add to userland to make a warning disappear and/or to allow a system that previously failed to boot to now boot. So this gives strong incentive to userland to adopt the new API, provided there's a way for the developer to understand what's happening (which the warning does). If we do it right, all we'll hear are userland developers complaining that those stupid kernel developers have changed their API again and really don't know what they want. That will be a good sign that the warning flows back to them and that adoption is taking. And if the change is small enough, maybe it could make sense to backport it to stable versions to fix boot issues. With a testable feature it does make sense. Willy