Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp92557imm; Thu, 2 Aug 2018 14:37:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeMrDI6dLXLs6CUUyI4Z6QDoiGbEFKHt37QO8h7AIyrXe2vK5wcJwE7HpVpAvAHMTJKp5YO X-Received: by 2002:a62:d98f:: with SMTP id b15-v6mr1244263pfl.1.1533245834871; Thu, 02 Aug 2018 14:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533245834; cv=none; d=google.com; s=arc-20160816; b=hK5dvLzMfTchmCtOtKhNBi0y4QfZKVZIVsxMOhYQ0mcdn9E1gT9jfbeXP7zCAjGoUM pSrejsWqatWKlwZWjESlpC6prOPYo/49bgSKuSxXX257mIPNHuglLIYkA6TwCjGcNyXJ nDCcFa7/6FI31prbUZValjPuInUc8hqe67pGtejHrD8IOzBnH2aeV9D+QUWZcJsm+H5Y 8o0PU/RsWOrEJLEu2c3dGW1tD2CrVmMiKg2HhafvdU2oRCuHG3ioNZ77V1HTzTjr1V2J sq7QOaHgFkvtdb5uBdPt87CqmEnWOoDaYmyvxhBiTTjdSWC87qm+cRtueqXkrOtQ50hi TE1A== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=KwlrU/CPyV/Q35bT5wl/mW434v6Jsvo4rIN20TKx7dQ=; b=EGotAIXlNl49Mspo1Wdn6m6JUvwr0zpMVqMxWE3He9cniqG1JH3HxEcHTXRVHgI7ks 6rejiFlzBsRijDHlMdM7e1Ctl5I/Px5Xnpu2OAiqr8bILeQVscJcq/JkUyLIT2TTs2Ri 7/Wrvsq6p8sk74cw5L9jyG93MD/10kULw+yomcN4kHvKiFjXGdgziRGr2liDGSTHC7gg adYyOf1jFrslXOueNjkAtOuTgY1IoG1qUWZqo4tuF0FnyTQfekfDNEeDqzM/urLr1ru+ OrxYQPmOhXWPWpsANOhyrkO2eQWV0pPnco19KAU8Hch5RRJgKe94+qz5QMkoiq8/KOxr 52Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=eoo7n5h6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2-v6si3263281pga.141.2018.08.02.14.37.00; Thu, 02 Aug 2018 14:37:14 -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; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=eoo7n5h6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732156AbeHBX3M (ORCPT + 99 others); Thu, 2 Aug 2018 19:29:12 -0400 Received: from imap.thunk.org ([74.207.234.97]:60032 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbeHBX3M (ORCPT ); Thu, 2 Aug 2018 19:29:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KwlrU/CPyV/Q35bT5wl/mW434v6Jsvo4rIN20TKx7dQ=; b=eoo7n5h6+ZkizYI/GMND7PIFLn TO5Cv4IqM/GngeE9p65J26+Y4zcKVpmr6hFG9Zyq+qAfGMKSAgXBIzpumge5f0Pb01+dUgpaCU4Xo 72WiNkb0UFfosb1toKLvVMQZVCy9mvbCHRE0XhYHxnh63MXZEf9YA5ygQ4NF1WBWqDnk=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1flLGK-0006Us-14; Thu, 02 Aug 2018 21:36:00 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 243E67A64C9; Thu, 2 Aug 2018 17:35:59 -0400 (EDT) Date: Thu, 2 Aug 2018 17:35:59 -0400 From: "Theodore Y. Ts'o" To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net Subject: Re: [PATCH v1 1/3] random: Make crng state queryable Message-ID: <20180802213559.GA32066@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net References: <20180731191102.2434-1-Jason@zx2c4.com> <20180731191102.2434-2-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180731191102.2434-2-Jason@zx2c4.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 09:11:00PM +0200, Jason A. Donenfeld wrote: > It is very useful to be able to know whether or not get_random_bytes_wait > / wait_for_random_bytes is going to block or not, or whether plain > get_random_bytes is going to return good randomness or bad randomness. > > The particular use case is for mitigating certain attacks in WireGuard. > A handshake packet arrives and is queued up. Elsewhere a worker thread > takes items from the queue and processes them. In replying to these > items, it needs to use some random data, and it has to be good random > data. If we simply block until we can have good randomness, then it's > possible for an attacker to fill the queue up with packets waiting to be > processed. Upon realizing the queue is full, WireGuard will detect that > it's under a denial of service attack, and behave accordingly. A better > approach is just to drop incoming handshake packets if the crng is not > yet initialized. > > This patch, therefore, makes that information directly accessible. > > Signed-off-by: Jason A. Donenfeld > Signed-off-by: Theodore Ts'o Applied to the random.git tree. - Ted