Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1825197ybg; Sat, 19 Oct 2019 03:17:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDAn1eKcAviY8pT2UCO/B5DIdN5bnPP4mSHW8+2RnqfIG/RQU1A21C3oBHOY23+FU7Tlov X-Received: by 2002:a17:906:1542:: with SMTP id c2mr12507887ejd.80.1571480266559; Sat, 19 Oct 2019 03:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571480266; cv=none; d=google.com; s=arc-20160816; b=BS14I+kw1J3ejA+jNv97P2GaNqE/jrg3E5lasUtBURA2K5oNwWVn1ZoMOI8GP55iC5 wbd6UXM0Nz2jGvQ0sEr7EmVwdPdcZZX+lnYkn+26QHoJUULL3EGhvHprHPW5YTq8RHev E4C9fTcNGrxNv53/cArj3g2qYMBHzt/AI9fZDaqrZjIF11wSLem7R1gpKmRJ+G9RxzGK wFLgfJZUohpnALwtiM4cBSkAcu/LuiAwngKfX2t0k8V9dZ39TkzLDuBBt6gmHsJ8dJr/ njiwdjqP+GBRjVflMD97heFVcBrJJCQi7+s9AktrckWi8iVTFzxtCpzOSJNUwQ8c1Z1Z aixg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=kJGG7PO0RUhSQZfWA72JDOaRfyu4ezCwagZNQxzoABI=; b=YG50X+YLAKbG3CX6WQmP89hTvcb6tZFh0gHFzTLczykRKsJN3WtjGJDgw3NDpIEj02 T/Jg0LXEu2UMza1rzt2W9dSJ2jtcLsfRaabr1fqEfYmD6AhzZcZX4/TrqFiYm9VR71m/ srQR1081DST6EhWVzm+xZIXvZb7ePLmMqWdlfid9L5LlmCYDVesBBDKgjnm54/BqrFdG W9yRmbATsqpgJ2MCArRUvOyL95NwzFROJf+x5XOv84KpGaAqgQa7Q+a2unLtbihTyUwU lP8sStiuy2YubpLdKJTTvOqr4nXkvUfum+kHhSQMuKOaWf6Y5rPXkOygjAHdFrStnbiF 0wDA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si5022685edo.172.2019.10.19.03.17.23; Sat, 19 Oct 2019 03:17:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726212AbfJSKN5 (ORCPT + 99 others); Sat, 19 Oct 2019 06:13:57 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59107 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbfJSKN5 (ORCPT ); Sat, 19 Oct 2019 06:13:57 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iLlkA-0004MK-9K; Sat, 19 Oct 2019 12:13:54 +0200 Date: Sat, 19 Oct 2019 12:13:53 +0200 (CEST) From: Thomas Gleixner To: Ingo Molnar cc: Linus Torvalds , =?UTF-8?Q?J=C3=B6rn_Engel?= , Linux Kernel Mailing List Subject: Re: [PATCH] random: make try_to_generate_entropy() more robust In-Reply-To: <20191019073907.GA101301@gmail.com> Message-ID: References: <20191018203704.GC31027@cork> <20191018204220.GD31027@cork> <20191019073907.GA101301@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1579266021-1571480034=:2098" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1579266021-1571480034=:2098 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sat, 19 Oct 2019, Ingo Molnar wrote: > * Linus Torvalds wrote: > > On Fri, Oct 18, 2019 at 4:42 PM Jörn Engel wrote: > > But from a softirq or threaded irq context that 'interrupted' regs > context might potentially be NULL. > > NULL isn't a good thing to pass to mix_pool_bytes(), because the first > use of 'in' (='bytes') in _mix_pool_bytes() is a dereference without a > NULL check AFAICS: > > w = rol32(*bytes++, input_rotate); > > So at minimum I'd only mix this entropy into the pool if 'regs' is > non-zero. This would automatically do the right thing and not crash the > kernel on weird irq execution models such as threaded-only or -rt. You don't even need threaded-only or RT. The timer is fired in the softirq which very well can happen from thread context in mainline. Thanks, tglx --8323329-1579266021-1571480034=:2098--