Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp946672pxb; Wed, 6 Apr 2022 05:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy4FB0FNvDZO4eViYtHT1zJ8ixnFPSbN0l7uLh/UObnVU7BCancQRc5KA47GxM33n2F6I8 X-Received: by 2002:a05:6638:3826:b0:323:6ad1:7ae with SMTP id i38-20020a056638382600b003236ad107aemr4368262jav.47.1649246626544; Wed, 06 Apr 2022 05:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246626; cv=none; d=google.com; s=arc-20160816; b=w/W8T0FnIHT2dyx5q44/6KOpsN39g/1cQazNN5U4TQpHmG20KspP0uzXZTjHqiBLXI x3P8mlVWL0rHWBfOBz3+lJPQWYupVlxAS4qsAh13OHkaITjsl8sQ6IwKcxB7cii9Pcf1 lyv6mFlNZ3yjwRqvh1WaMFQT+v87KnVLY/HSqNR9eGAFQu+0bvXT0LCf9TKPve1hISgd uMOtd+9gvg8miV29/ZN9DoORRMxzK5/SFVF0xR8aTlStGPU7DplFRa+dpSYDyMnpY6mY 5SfF8ZGXcXuwXKItIGN4oKKIH+J9Z1DkgRQ9U1l0FezNO1k63xTRJ9BM8K1a/CDqmirG /18g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oLYBS6qSnQJDgHjg4Cj/j2Qud2mtZddgHInB5HJPeJI=; b=GPLSbNMMtm9NQA9y2Gunpn1Flc+LxAzawFsSFgbCx154/8SSRjGh83V1vlPoCNMLDS D4QFov6KnLxbr3uR7ltw8jXp2+bywGZ6CVDtxKznjjWD0Fusy0rdzYaYKe2xcF7wMaOy Au4cDX9+1g3SA1Oddc8cNjXwsgxEqi0p4VHXz4O947AP4wGSMajYWHGJ0Y/rgBKTZvP0 SSvUdkiTYrL7rtku1alCpJK2E0Ehta1RqkQmofqCAIx/rjWRM7PxPI29zr6cAUHpnXTw /5xmELJ3xx/rHaOC1EgNJmoDY/37jsvD1gM4hrJdXqTfBv7rO4YJcBM1NM6kcMLXox1B Qfug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LjoNMKdo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y7-20020a92d807000000b002c7c7bfb686si4970965ilm.36.2022.04.06.05.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LjoNMKdo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB26C67547F; Wed, 6 Apr 2022 03:30:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576621AbiDEXKw (ORCPT + 99 others); Tue, 5 Apr 2022 19:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572913AbiDERTv (ORCPT ); Tue, 5 Apr 2022 13:19:51 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B162852E2A for ; Tue, 5 Apr 2022 10:17:52 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id b13so109401pfv.0 for ; Tue, 05 Apr 2022 10:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oLYBS6qSnQJDgHjg4Cj/j2Qud2mtZddgHInB5HJPeJI=; b=LjoNMKdoa2fQAXS+kSSP5+w5CB9a38NU+nsairp0fAYRVkSuE5pCKkLbh+w3mkv3kU f/D/yVZPMsLyjmGoclxJf72/hNgGVWsb+AUghM2UbT1G6fLt9RZxs02Aq+RzxkpND3Ls 31KigSq940fcdUut6dq4VTF2P2un1IquDcydA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oLYBS6qSnQJDgHjg4Cj/j2Qud2mtZddgHInB5HJPeJI=; b=dnQYxpKYERPDIyRPoGRCskmT/b1XCLTce/jdwBr7S4Dieyxi7xMDz0PGyP7049pE4s 5C6Jt4n8NPCRUXLfBlDYK4e0JbzDndW+PP8xZZ/N4baldUH5OYjUA70r5uEm6dkzR7N8 Hz6jlbf7CMMc2GTA1JcRsTCLzFrdi2LRuWNSgsWNQAupYA0rxxvv7Db+dclfiZg9EJF6 liurCRERIPYk+Aq9Qr9Z5a4oQ3leJtH0byMwaQfO996sKKiiMlUoc3lh7pG1gbavkrG1 frstsKIy1t+ZwHsI1NiYFVD7WibRBlvGVq9t72OnpGw4PRGxVfc29F/iqzXZSxKZPzPG ZkQw== X-Gm-Message-State: AOAM531ylQMsvQCIEphkVXdsuBib1xrVDul5fRaaBy8X+g3kwjCPuqGN h0x2ZcvHxyz7eQ3EIljS9Mm2qA== X-Received: by 2002:a62:e213:0:b0:4fa:6b13:3a9a with SMTP id a19-20020a62e213000000b004fa6b133a9amr4665590pfi.18.1649179071654; Tue, 05 Apr 2022 10:17:51 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p10-20020a637f4a000000b00373a2760775sm13654616pgn.2.2022.04.05.10.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 10:17:51 -0700 (PDT) Date: Tue, 5 Apr 2022 10:17:50 -0700 From: Kees Cook To: "Jason A. Donenfeld" Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, PaX Team Subject: Re: [PATCH v2] gcc-plugins: latent_entropy: use /dev/urandom Message-ID: <202204051016.4E9DD89@keescook> References: <20220403204036.1269562-1-Jason@zx2c4.com> <202204041144.96FC64A8@keescook> <202204041953.D7E0BA15@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2022 at 02:38:58PM +0200, Jason A. Donenfeld wrote: > Hi Kees, > > On 4/5/22, Kees Cook wrote: > > On Tue, Apr 05, 2022 at 12:47:14AM +0200, Jason A. Donenfeld wrote: > >> On Mon, Apr 4, 2022 at 8:49 PM Kees Cook wrote: > >> > This mixes two changes: the pRNG change and the "use urandom if > >> > non-deterministic" change. I think these should be split, so the pRNG > >> > change can be explicitly justified. > >> > >> Alright, I'll split those. Or, more probably, just drop the xorshift > >> thing. There's not actually a strong reason for preferring xorshift. I > >> did it because it produces more uniformity and is faster to compute and > >> all that. But none of that stuff actually matters here. It was just a > >> sort of "well I'm at it..." thing. > > > > Well, it's nice to have and you already wrote it, so seems a waste to > > just drop it. :) > > > >> > > static struct plugin_info latent_entropy_plugin_info = { > >> > > - .version = "201606141920vanilla", > >> > > + .version = "202203311920vanilla", > >> > > >> > This doesn't really need to be versioned. We can change this to just > >> > "vanilla", IMO. > >> > >> Okay. I suppose you want it to be in a different patch too, right? In > >> which case I'll leave it out and maybe get to it later. (I suppose one > >> probably needs to double check whether it's used for anything > >> interesting like dwarf debug info or whatever, where maybe it's > >> helpful?) > > > > Hm, I don't think it shows up anywhere, but you can just drop the hunk > > that touch it. I can remove them all with a separate patch later. > > > > Okay. That's what I did here > https://lore.kernel.org/lkml/20220404230709.124508-1-Jason@zx2c4.com/ > so awaiting your merge. (I still find all aspects of v2 more > preferable for a variety of weak reasons in case you'd like to merge > that instead, but v3 is available now.) v3 uses a different check for the -f option, though? Isn't that preferred over the v2 method? Also, I did some quick benchmarking, and any difference in runtime is completely lost in the noise, so that's good. -- Kees Cook