Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5666411ybe; Tue, 17 Sep 2019 11:32:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX9jmab1yO+pISwDiV4W9WdZ0UCElJETSlB5FwZp7geU+9GUzDwyQ91So+ICZ7j5BDPKil X-Received: by 2002:a17:906:4d08:: with SMTP id r8mr3098210eju.283.1568745151101; Tue, 17 Sep 2019 11:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568745151; cv=none; d=google.com; s=arc-20160816; b=S0xg7B7Ya5OOwJVAeXI8dCe83V92ry7pBnIAU04ikgdc3HMTccPzlxGK6FhzXD9zas dx+ByXuj5dUqJEscIDM6Nofu9UT/rY79zVViL9K62TzNHxyi7mHFBpkhJYCKVbjQ+Pw3 s3raBrswKdkazgtqCFwZXhHDeY9m/m2zbCoiy+SGN3KpU3kBlYnNujO+ZjHEcRRIrH0g pTaxbdZo/t4uWUKO18B02emfHkdnvsqQDap7VXdkbaFhQgbSAlc/Akz2XYPQ/HcQDP9X bFKfu7fgpAiBjIirY2tXLgRYw9Zw0ChSkiy+QQSU8B8SRfg7BnvhNqbQ8+tTLJu/L/pL IfLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=coErz4dPr7gD5SSDzn19ki/WPtgTUffgayvtY4QtR6w=; b=q9SnHFGNTxopEcV9foR4fD1hhKKRqA1yPo9FR7F0DZ8J0dQ3AyD8cTzby0N2EHBIVN 296vulW+pQkDpY1rTDLVLBX9p0ModDhabtO4lZlDulCGdcJ+hrkBKMn0n3empiYV/+jP 0CD5crR9EGPC1U6VmP5bgSQPEjOf4Kvh23ajuo/dwD1rGM+2DwcVHgxNgamI+M26LLML v9tjZ4/KlNS4rg0wn4HvHZorwzBSaxiOxV9Aq3HuDOc7bW1qK3cnLvPlkEMPbVwZtxG2 G4LPbtLiM6I+aghGy/xP8+1vmW3im388ZJ9MOu4hHDuj5fqB+EpQIvAaYcxkhNfGYVO1 5BDA== 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 si9si162379ejb.97.2019.09.17.11.32.06; Tue, 17 Sep 2019 11:32:31 -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 S1726953AbfIQQIq (ORCPT + 99 others); Tue, 17 Sep 2019 12:08:46 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:40620 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfIQQIq (ORCPT ); Tue, 17 Sep 2019 12:08:46 -0400 Received: from gardel-login.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by gardel.0pointer.net (Postfix) with ESMTP id B3788E80FFC; Tue, 17 Sep 2019 18:08:44 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 6D90D160ADC; Tue, 17 Sep 2019 18:08:44 +0200 (CEST) Date: Tue, 17 Sep 2019 18:08:44 +0200 From: Lennart Poettering To: "Ahmed S. Darwish" Cc: "Theodore Y. Ts'o" , Willy Tarreau , Matthew Garrett , Linus Torvalds , Vito Caputo , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , "Alexander E. Patrakov" , zhangjs , linux-ext4@vger.kernel.org, lkml Subject: Re: Linux 5.3-rc8 Message-ID: <20190917160844.GC31567@gardel-login> References: <20190917052438.GA26923@1wt.eu> <2508489.jOnZlRuxVn@merkaba> <20190917121156.GC6762@mit.edu> <20190917123015.sirlkvy335crozmj@debian-stretch-darwi.lab.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190917123015.sirlkvy335crozmj@debian-stretch-darwi.lab.linutronix.de> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Di, 17.09.19 12:30, Ahmed S. Darwish (darwish.07@gmail.com) wrote: > Ideally, systems would be configured with hardware random > number generators, and/or configured to trust the CPU-provided > RNG's (CONFIG_RANDOM_TRUST_CPU) or boot-loader provided ones > (CONFIG_RANDOM_TRUST_BOOTLOADER). In addition, userspace > should generate cryptographic keys only as late as possible, > when they are needed, instead of during early boot. (For > non-cryptographic use cases, such as dictionary seeds or MIT > Magic Cookies, other mechanisms such as /dev/urandom or > random(3) may be more appropropriate.) > > Sounds good? This sounds mean. You make apps pay for something they aren't really at fault for. I mean, in the cloud people typically put together images that are replicated to many systems, and as first thing generate an SSH key, on the individual system. In fact, most big distros tend to ship SSH that is precisely set up this way: on first boot the SSH key is generated. They tend to call getrandom(0) for this right now, and rightfully so. Now suddenly you kill them because they are doing everything correctly? Those systems aren't going to be more useful if they have no SSH key at all than they would be if they would hang at boot: either way you can't log in. Here's what I'd propose: 1) Add GRND_INSECURE to get those users of getrandom() who do not need high quality entropy off its use (systemd has uses for this, for seeding hash tables for example), thus reducing the places where things might block. 2) Add a kernel log message if a getrandom(0) client hung for 15s or more, explaining the situation briefly, but not otherwise changing behaviour. 3) Change systemd-random-seed.service to log to console in the same case, blocking boot cleanly and discoverably. I am not a fan of randomly killing userspace processes that just happened to be the unlucky ones, to call this first... I see no benefit in killing stuff over letting boot hang in a discoverable way. Lennart