Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2741537pxb; Mon, 31 Jan 2022 03:22:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJztB0IbvmqVkndxzZUdyNfWxI2WBb1f1JpmkFShUHjTKnj4JOSmGO0DM5DGmT+m0J4rhrGV X-Received: by 2002:a17:907:7ea5:: with SMTP id qb37mr16503040ejc.573.1643628121585; Mon, 31 Jan 2022 03:22:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643628121; cv=none; d=google.com; s=arc-20160816; b=0LtKMoDM/otKu9F5i818rXAcTm2jFcUngl6YcteYUOAKTvgtiysej51e/Px2XV9pxZ XOJQeQWBtVmpkjmWwIBKoL4+IYShNwweovtd/vP9aOLrbCRg6dSiyI6z4/seEVpMjDU3 tLg5hB11Tf8o7pyhQa4iZk8Ep+8B/MNCTi/uLLnlae3yN++0PtZ957KbopkOU/tHiv10 uA1jeTp4lB+Jk5u30Xu4vp6mDVlI5VKXeF1L36Bgi59G4nvoxJmUKFQ2j8aLqEW5Q8Jt o7lgb+3RDkppFyRLlCkZEIOVJ+D9+KrnQgqZ2MjxN90U9EQ+PikqsTymqGR36ASdlJhR Fuhg== 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:dkim-signature :dkim-signature:date; bh=p6B/QL3zGvAqYCZbyxVnMq+IjoMyfzI0aBUO5B432cA=; b=Phe0Z6+xrockC99yReSuPI/92ibvVCtlNt+nFG+Ubs6HFYdp+wIPejuJtS46mBSdPb DyZuteiqujAOn3upZJ32RKXq/SR5yJotXQAmfxb2kUijU2DhNKscliF+sCh9TjW+OV8r 20buFXKkKEaPIAqF2UVKqP4UaRvez45GEKexQ1CrSkFY+t5n4Itctyp1/IY6mLSzM/Z6 7wU4bKokI1qAPPmWnlqNOZ4DffE6h1xshSe8rKsccuIzohvcJyU83hfeWBT3srXkmi5k Zil64XYbN/MVCWxQAKMEr1Q6GqfwaPey9rglTamy1XQZFPH/fCuZy5dDwbkeqlKgpynh DgBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kQe9RNdv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=C61544Ui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si8683629ede.211.2022.01.31.03.21.37; Mon, 31 Jan 2022 03:22:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kQe9RNdv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=C61544Ui; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350410AbiA1RCj (ORCPT + 99 others); Fri, 28 Jan 2022 12:02:39 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:44348 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350398AbiA1RCi (ORCPT ); Fri, 28 Jan 2022 12:02:38 -0500 Date: Fri, 28 Jan 2022 18:02:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643389357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p6B/QL3zGvAqYCZbyxVnMq+IjoMyfzI0aBUO5B432cA=; b=kQe9RNdvpVldsKvVJQUPyldTqWefmeGNFNs0oMM4rfnYbq18Tjedq0fMY6RyaYNCznNxG/ uQoKeKQlHv+6hYhzfp9UVST1q6DeKRz4MlZdJ5HZXjwZEfrHGMa/ME+KGbQ28vFC+JqAQ+ Ujgd/aTATzlxeWjKDnntFdLdgygLt7dDt+t0fxw8bscilScnOnmhTM7nFk0SVxHK/NXKNH 0mh3RK16cUI3If3yD+asyObkoBklbP1qjecEtGJYrVCZqXKWy/soU7qlcNemKm0LiEHfHb qyLK2/F6tJz7X92mZITrixH4aCSzdxUXlgDgjwQbpdoLo7ZD2OVaoaduHeNxWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643389357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p6B/QL3zGvAqYCZbyxVnMq+IjoMyfzI0aBUO5B432cA=; b=C61544Uiu8Ilho88QpjO0x2krd7AbuYZTdxzUOa0zaOMz8ipb3qIjfySpOLGKjaW/dao0a +wtfHenuhXqVq5DQ== From: Sebastian Andrzej Siewior To: "Jason A. Donenfeld" Cc: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , Andy Lutomirski , LKML , Theodore Ts'o , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Thomas Gleixner Subject: Re: "BUG: Invalid wait context" in invalidate_batched_entropy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-01-28 17:28:47 [+0100], Jason A. Donenfeld wrote: > Hi Sebastian, Hi Jason, > Gotcha. Surely, then, Andy's patch at least goes some of the way > toward fixing this, since it outright _removes_ a spinlock_t. There is > still the other spinlock_t that you want removed, I realize, though > this doesn't appear to be the one from Jonathan's bug report. It > sounds like Andy's patch might be one side of the fix, and your patch > the other? Only if we want to keep that lock a raw_spinlock_t. And this change extends your IRQ-off region. Before I was only worried about that one lock and all the callers. Now we have a little more possibilities. From looking at get_random_u32(), the whole worst case includes the whole of extract_crng(). So we have the possible call chain crng_reseed() -> crng_finalize_init() and here we have wake_up_interruptible() and kill_fasync() which both can't be called with disabled interrupts. > Jason Sebastian