Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3294567rwb; Sat, 3 Dec 2022 02:28:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf7AKlwmjVqot22uZXYKSWtE2c7DGr7ANBgOZ82eavBM+Jqqc/d2dBz3R2wAt3Mn5/HWwkCL X-Received: by 2002:a05:6a00:2396:b0:56c:318a:f808 with SMTP id f22-20020a056a00239600b0056c318af808mr58534428pfc.11.1670063336664; Sat, 03 Dec 2022 02:28:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670063336; cv=none; d=google.com; s=arc-20160816; b=f8By9zzK1tphtER65HKuUFg3+ky+lqIRKuNspXFNNCGrR7C1ICEFgX7eVNTI3PAT9y bPle91BaC0CGtCdo9nt+uR96AbEW6bGzi94wNr+bYAA18qe3oE9MGWAwoa4ISCbTCGkW WqBIlUElVB8XMrUamhNBIICjalNpNP6fgPKUwf5atM8k69/VYZY+KL+P+9R1l//ubNiu AunpRT74j1tpqh3TH5JdC/sMEO9V2d63LcHBg864ZM6fGu714By8MZyZtaNZL20AlVw+ bTlTggxwkWr8eKLPg3z5W+lpcEiXoe42YwF+MIGa62bz9RkqGne6nRkbb5y0GVrtWih8 c8tA== 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=B99/rGGxOgBt2SCG0ilJmP42Uqhic94NePrcyql2Y30=; b=KtVVxe3leV2ACPQ9DoNiR+BVYBymQe0gmNxUVKpA1+OPO88orEMgpVZ6eB5u6ZH6gb ffzhhFYyP1kgdN9ICxcJ/Mxs6vT5u/Ez5v46bs5LkYxRg5OGcuYZ4TAw1BpFdJvDx5Jq VTMn3nlWlnRUOpf6v8myO9V+iVxMJ7xZ2hcz7h+DsYus7zuAJfUKAVhtF9EjoMUUG2FA bDh0K0pBgBxMFMGEFiXkdkG+rHEtMgk2+STuPIrndNytuj0d/3P7o7vMwtPvSLley2zm sl7E3aRweNyaPXxcXmfLjXrxhmvUOu7K04bpf64yZMpaatJZA1aXKQJ31MSB0TZATIOP CZAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=OE1z0XMB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090a9a8800b001fb23f3f238si9223742pjp.71.2022.12.03.02.28.43; Sat, 03 Dec 2022 02:28:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=OE1z0XMB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbiLCKZQ (ORCPT + 99 others); Sat, 3 Dec 2022 05:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiLCKZP (ORCPT ); Sat, 3 Dec 2022 05:25:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8825E4A05A; Sat, 3 Dec 2022 02:25:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 28C76B802BE; Sat, 3 Dec 2022 10:25:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93045C433C1; Sat, 3 Dec 2022 10:25:09 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="OE1z0XMB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1670063106; 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=B99/rGGxOgBt2SCG0ilJmP42Uqhic94NePrcyql2Y30=; b=OE1z0XMB2PBjouhlOhHQ1424GlPkFJvMb4D+3b+9O03547ABcw8eq7lOWNL27O9hAAzN8E e/THcxh1t18VPT9Uzst/p2p5xJ+MpjH2Km7wJtEjXNVf6QMvuPJvCop2WIM76zxmER/cBa MLrdEdSPaW+11jEn7cc8GHuhP/j+e4Q= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 6d6b524c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 3 Dec 2022 10:25:06 +0000 (UTC) Date: Sat, 3 Dec 2022 11:25:02 +0100 From: "Jason A. Donenfeld" To: Thorsten Leemhuis , torvalds@linux-foundation.org Cc: Jarkko Sakkinen , peterhuewe@gmx.de, stable@vger.kernel.org, Vlastimil Babka , Jan =?utf-8?B?RMSFYnJvxZs=?= , linux-integrity@vger.kernel.org, jgg@ziepe.ca, gregkh@linuxfoundation.org, arnd@arndb.de, rrangel@chromium.org, timvp@google.com, apronin@google.com, mw@semihalf.com, upstream@semihalf.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v3] char: tpm: Protect tpm_pm_suspend with locks Message-ID: References: <20221128195651.322822-1-Jason@zx2c4.com> <9793c74f-2dd0-d510-d8b6-b475e34f3587@leemhuis.info> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9793c74f-2dd0-d510-d8b6-b475e34f3587@leemhuis.info> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-crypto@vger.kernel.org Hi Thorsten / Linus, On Fri, Dec 02, 2022 at 10:32:31AM +0100, Thorsten Leemhuis wrote: > Hi, this is your Linux kernel regression tracker. > > On 28.11.22 20:56, Jason A. Donenfeld wrote: > > BTW, many thx for taking care of this Jason! > > > From: Jan Dabros > > > > Currently tpm transactions are executed unconditionally in > > tpm_pm_suspend() function, which may lead to races with other tpm > > accessors in the system. Specifically, the hw_random tpm driver makes > > use of tpm_get_random(), and this function is called in a loop from a > > kthread, which means it's not frozen alongside userspace, and so can > > race with the work done during system suspend: > > Peter, Jarkko, did you look at this patch or even applied it already to > send it to Linus soon? Doesn't look like it from here, but maybe I > missed something. > > Thing is: the linked regression afaics is overdue fixing (for details > see "Prioritize work on fixing regressions" in > https://www.kernel.org/doc/html/latest/process/handling-regressions.html > ). Hence if this doesn't make any progress I'll likely have to point > Linus to this patch and suggest to apply it directly if it looks okay > from his perspective. I'm very concerned about this. Jan posted the original fix a month ago, and then it fizzled out. Then I got word of the bug last week and revived the fix [1], while also figuring out how to reproduce it together with the reporter. I emailed the tpm maintainers offlist to poke them, and nobody woke up. And tomorrow is rc8 day. Given that this patch is pretty simple, has been tested to fix an annoying regression, and that neither of the three maintainers has popped up this week to get things rolling, I think we should just commit this now anyway, to make sure it gets in for rc8. This way there's still a solid week of testing. I'm in general not a big fan of the "nuclear option" of not waiting for out to lunch maintainers, but given that it is now December 3, it seems like the right decision. [1] https://lore.kernel.org/all/20221128195651.322822-1-Jason@zx2c4.com/ Jason