Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp648701lqp; Wed, 22 May 2024 15:53:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3PLuJBrHgswrxmqREukhbv6urFnadpju+Wd+mSAoain+zHr2CpybAdDPaFubXro7hHxkqR/ZxAgysywB6rUH8v7CSBZ1iKQc8aPM4UA== X-Google-Smtp-Source: AGHT+IEPnHqQmGy3iAdK081V/BNFvWWUtiQBqQbzflRtkURZcG2CxJa6GU9PUXw61+ELkt+LvUUY X-Received: by 2002:a05:6512:1cb:b0:51f:2908:df48 with SMTP id 2adb3069b0e04-526becaa3fdmr2026724e87.18.1716418433039; Wed, 22 May 2024 15:53:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716418433; cv=pass; d=google.com; s=arc-20160816; b=XGhBoeQ403IHPHpisH4k6pLCD/c8qNYdHsnIw4m1p2/56gWPsGkn0gZ1rkS0h/JS0O 0mUyHYu+iEw22JWzZy93BkMErLMCC6ierf8Go4uW4x7ZBflTkq+djB9NR0yGJM0/T3Vn aymh7lYlyixtCckbMhTm4aH6pNGgH6ZIr5gNf7pAToVxjEPr4UT79sxYHes8JyF7FvX/ 4icYCU7DmxsQej2SKPdWIe1UrwJiOhx9m2jN4iz/TRaqpOyBdCxo56xzMG2/mW7MZJnb 5Zg2UD5m8CHystekxijtzT0E/5UG4Qq0TvUS2qdFSvUmhGxvApm/k4LkefRarucyE44h ZCKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=5pQI3o2sJHQ9VDDihE2wM0f+XoWWITjrXXHCRcKXU50=; fh=pMOPrFw/tPYdUiZdVwiCUEBxGnuApaP1/G0DM/dUTgk=; b=GrgelpJNsyh0JRzKmZkMg9R4nN4Bvr6YDDADUfZHRWXoz1puPGTigFNgVBwqCHj2rY WxZh1QNfKKCBDsZ42aMOLIRT8gIAD2EGvf/iv4HnzZ8WSG8flrzY4nW+2Imz0RhwKjIQ ZyToZT1RMooPit+ogcXoovKgfuQ/75MTBckXJVmIQ2lWRutkqsbjJqoFF8L6KLpGDpGu JuRIh6RU/k36WgItIQnZCvE7lBegucEIgmc6UG4wnUfdmXKMH0fki+EzG8P+4bKRwS+5 NKYL7/7gDYVeeqXrQXBNsieuw3to9Mjp+FQuCzphU76IXOtxiAfyjxGKTbafefcybMIC Rx3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="TLct8/br"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4336-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5d5f8822e0si544584566b.948.2024.05.22.15.53.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 15:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="TLct8/br"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-crypto+bounces-4336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4336-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BDADD1F22143 for ; Wed, 22 May 2024 22:53:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D93841494C1; Wed, 22 May 2024 22:53:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="TLct8/br" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A51814901E for ; Wed, 22 May 2024 22:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716418424; cv=none; b=klsMkH+NDHgvl+b5WHdFZ35sUjgUajzuGf0M44FK0WgibsswNfDvRF1CAS3Cr1z4tqsAablRbTtkM1r1xzF01d9qbcoFgko0JBjL4mKyZjhJKT8b4J5JjWQKCOJNjI6i3NRqOL/NOMlEo4f2rx/gMUT+9xf2LvDJJGOOOYT0RO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716418424; c=relaxed/simple; bh=s+AFZiWYdfo9LHxXiFDhhaTaz5In1NnrT6e/kTcTOec=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=A793TuUOnylTDdutjFmLJVf6sGxCnbhXZh/azWnfxcf+e+NJ81HWWBSBiTvOlzsnVY5Tg038kFyUmQjbeDmgevIdXDV3EVUGLp0ET7bSM16AK7h3qSCcOJ1U6+/tTUcyBReg+JPcqBygWB633g1ERH2eqsW5IXYV80D6/dL8gIk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=TLct8/br; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a59cc765c29so147143266b.3 for ; Wed, 22 May 2024 15:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1716418421; x=1717023221; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5pQI3o2sJHQ9VDDihE2wM0f+XoWWITjrXXHCRcKXU50=; b=TLct8/brfZdjqNLgRvxC3MDlmayHtFrgF3KOIw6a6mYV5omeGAMCnHs95OIPS+J1LJ 2j/Ed8UaBGMrjPMlqB8J3NbBmJolZ6oZ7TWyFe82AFMRPBgf5oG4h6hMgTG2OlmlTD+L 0HIdcY0sr20y+ME3CtXxViJgMPmoBprD3eQDA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716418421; x=1717023221; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5pQI3o2sJHQ9VDDihE2wM0f+XoWWITjrXXHCRcKXU50=; b=oZZ4PtXQiwVqik853BVF82HQQ3d40mv2YMTfZjgXqWbVF52R7sWZOcYOD65mshnAun 3ez+hsPHWnR+L3KfFyk0jP4935bWW4j4G35LGNOeNPL10q9utdJY1/18i/s4RpU8h6Ry jzzgmtLTMDCyQllHg0k4PU/A+F1YUZqjjIZ2OPIKHOsMz+ihbT85s4QOp9XYzSzdlbuN H9GfYp9VTQfdyemQmwqimA4o5NviWv++ob/kBS2guhZGlfUsEvhiLOWbb3YqVbQbN2Qg M/DL1ycUQftLTKqMq3I9e7dl+pdlOu+jmgToy4dSTk2RTnCfOZVJegakr9dx0v7R0rWp SRAA== X-Forwarded-Encrypted: i=1; AJvYcCVyHKh0vj2ZOv+Cnd+ooQ0kAus3DJF++ycPSe4kdEBYgoB9roaYW/220t2jtqON/dU4u1Ov20gsp8TzF1f8kQO2T013WYT/Xn64ISNn X-Gm-Message-State: AOJu0YxKJFWE8O93c7mPmFtD5nwD3bcFeAc7aHUHwwim37mQ6vatAt3j IX3W8VEV1MZmHf0/OST0ajaAdyO4pwvkw5/9U7yXs0jKroMW56UyFVC5nQ4gTbj07ZUBYmClcee buktcTA== X-Received: by 2002:a17:907:7858:b0:a5a:5b8b:d14 with SMTP id a640c23a62f3a-a62280a0eb9mr211224066b.40.1716418421310; Wed, 22 May 2024 15:53:41 -0700 (PDT) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b01602sm1854152666b.147.2024.05.22.15.53.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 15:53:39 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a5a5cb0e6b7so1081361066b.1 for ; Wed, 22 May 2024 15:53:39 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXlpC0MI+ZWq7XR2BE8F37/TfBdIUc1tJJZPa9DUIt0O+ZxoSN0+bVGiCd/TRtHlKg5Y9aYwOaBKZGecNpwJSl83uNzXA4vZeCJ5+YR X-Received: by 2002:a17:906:6945:b0:a5c:df23:c9c6 with SMTP id a640c23a62f3a-a62281673cemr222082266b.47.1716418419345; Wed, 22 May 2024 15:53:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <0d260c2f7a9f67ec8bd2305919636678d06000d1.camel@HansenPartnership.com> <66ec985f3ee229135bf748f1b0874d5367a74d7f.camel@HansenPartnership.com> <20240518043115.GA53815@sol.localdomain> <00bcfa65-384d-46ae-ab8b-30f12487928b@notapiano> <07512097-8198-4a84-b166-ef9809c2913b@notapiano> In-Reply-To: From: Linus Torvalds Date: Wed, 22 May 2024 15:53:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [v3 PATCH] hwrng: core - Remove add_early_randomness To: Herbert Xu Cc: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Eric Biggers , Jarkko Sakkinen , James Bottomley , Ard Biesheuvel , Linux Crypto Mailing List , linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, regressions@lists.linux.dev, kernel@collabora.com, Tejun Heo , Linux Kernel Mailing List , Kees Cook Content-Type: text/plain; charset="UTF-8" On Tue, 21 May 2024 at 22:38, Herbert Xu wrote: > > In this particular configuration, the deadlock doesn't exist because > the warning triggered at a point before modules were even available. > However, the deadlock can be real because any module loaded would > invoke async_synchronize_full. I think this crapectomy is good regardless of any deadlock - the "register this driver" should not just blindly call back into the driver. That said, looking at the code in question, there are other oddities going on. Even the "we found a favorite new rng" case looks rather strange. The thread we use - nice and asynchronous - seems to sleep only if the randomness source is emptied. What if you have a really good source of hw randomness? That looks like a busy loop to me, but hopefully I'm missing something obvious. So I think this hw_random code has other serious issues, and I get the feeling there might be more code that needs looking at.. Linus