Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3601724imm; Tue, 29 May 2018 10:00:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIQIiJCiLHBzDBTxNT/U4N+ZZWey1LqQme8T0ANwbdN/FU2fvH40RA+JGe/CirA15ZG9qMk X-Received: by 2002:a17:902:b216:: with SMTP id t22-v6mr14566273plr.199.1527613218695; Tue, 29 May 2018 10:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527613218; cv=none; d=google.com; s=arc-20160816; b=OZ5UWAdBhf/HoZ2iPB2E37KnIQPyM/6x6ljBJz+qpm11Bs68El0m4B2z+cZaK3uG1D WiiE5uoj+Jhqw/zSluYC2vrm9o5QyH0TU846ZH2oMqZVgIfx4NxxzREHVicqLTfbvro3 ZjbQt9qwKjSZlprEnfksGaXgJZSiz7UDXNNeWC3N9e4WtlEL6VEUa5I5kiAdV63lX83K VPfQi+S5oGNYa2Mfkdx8DjxPg97yZHI19V6kP+J5q6UwGRasYN3fpp0h/7Bqp4xcyGaE 6tyBFiXZY29LLhEJEdq+8XmgqD3bV8zkO3V3eYfaH5MbIuEAxe2Z4r6VOHiQS89ctEPN z+vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=1f2jo0jM+PrPCQbcERx70We8EgxrINMRoUYGsgTaimc=; b=dyAkbfn1Yql5zJHUybF8mOuHafu7WVhV75p5Jv5CHavQ99+WdDZg1OcdzmROX5G5Aj AMIX9PUqqDjZqj/mok6RxIHuNOBipaG1DVbfa+KorMmmovsMr7+CjTBBU03FzFr76SNA 68CKrgpUSqT+4GULsJD73SsXmVUlSrDMWjf/rrk6PK+XubkxyTh9wPbsL96Kpl0L//BG fl9I8MdaT2i1OBX15JYEd9JuopMtdf2IEvMVJbNGBQ+tIHPdunx7q2FtX0Jrs4IY6R+p +0XIIK0UDg55Z3vH7USyEXwu+M6uIfOvHeq6KQMAQGqraM+CsOggATKNoTkIeFZtgoOa CpRw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p91-v6si32901103plb.457.2018.05.29.10.00.04; Tue, 29 May 2018 10:00:18 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965273AbeE2Q6N (ORCPT + 99 others); Tue, 29 May 2018 12:58:13 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55838 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965151AbeE2Q6M (ORCPT ); Tue, 29 May 2018 12:58:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1FD38163AD2; Tue, 29 May 2018 16:58:11 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 732062166BC7; Tue, 29 May 2018 16:58:10 +0000 (UTC) Subject: Re: [PATCH] x86, random: Fix get_random_bytes() warning in x86 start_kernel To: "Theodore Y. Ts'o" , Kees Cook , LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Arnd Bergmann , Greg Kroah-Hartman , Rik van Riel , Andrew Morton , Philippe Ombredanne , "Jason A. Donenfeld" , Kate Stewart References: <20180529123800.19627-1-prarit@redhat.com> <71b5df93-2e21-f3c3-fa22-4488729daeb5@redhat.com> <20180529160743.GA7381@thunk.org> From: Prarit Bhargava Message-ID: <35cdbb04-7b1d-59ae-2ff8-af1d57751113@redhat.com> Date: Tue, 29 May 2018 12:58:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180529160743.GA7381@thunk.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 29 May 2018 16:58:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 29 May 2018 16:58:12 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'prarit@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/29/2018 12:07 PM, Theodore Y. Ts'o wrote: > On Tue, May 29, 2018 at 11:01:07AM -0400, Prarit Bhargava wrote: >> Kees, in early boot no pool is available so the stack canary is initialized from >> the TSC. Later in boot, the stack canary will use the the crng. >> >> ie) in early boot only TSC is okay, and late boot (when crng_ready() is true) >> the pool will be used. > > But that means all of the kernel threads (e.g., workqueues, et. al) > would not be well protected by the stack canary. That > seems.... rather unfortunate. Well, as stated the TSC is used as a source of entropy in early boot. It's always been that way and get_random_bytes() AFAICT has always returned 0. CPUs added later on via hotplug do use get_random_bytes(). Does anyone cc'd have a better idea on how to get another source of entropy this early in boot? P. > > - Ted >