public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	jgg@ziepe.ca, linux@dominikbrodowski.net,
	linux-integrity@vger.kernel.org, daniil.stas@posteo.net,
	peterhuewe@gmx.de
Subject: Re: [PATCH v3] tpm: Disable RNG for all AMD fTPMs
Date: Thu, 10 Aug 2023 17:14:10 +0200	[thread overview]
Message-ID: <ZNT+wvrX/hywsA4M@zx2c4.com> (raw)
In-Reply-To: <CUOYIJAA5HYW.2I8CO5JXZV6NN@wks-101042-mac.ad.tuni.fi>

On Thu, Aug 10, 2023 at 06:06:48PM +0300, Jarkko Sakkinen wrote:
> On Tue Aug 8, 2023 at 6:26 AM EEST, Linus Torvalds wrote:
> > On Mon, 7 Aug 2023 at 17:39, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> > >
> > > I'm not sure what's best or what Linus prefers. Linus - Jarkko sent you
> > > the wrong version patch. Do you want a fixup patch that accounts for the
> > > difference, and then I'll address the stable@ metadata deficiency
> > > manually by talking to Greg, or would you rather some merge commit
> > > magic, or something else?
> >
> > Either works for me, whatever ends up being easiest.
> >
> > However, looking at that v3 patch, that "should we enable/disable the
> > hwrng" is now repeated *three* times, and that first one is
> >
> >   if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM) || tpm_is_firmware_upgrade(chip) ||
> > -     tpm_amd_is_rng_defective(chip))
> > +     chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)
> >
> > and wants fixing anyway: you want parenthesis around the '&'.
> >
> > Yes, yes, it works (because bitwise ops have higher precedence than
> > logical ones), but let's not do that.
> >
> > But more importantly, can we just have a single helper inline function
> > for this and *not* repeat the same multi-line expression three times
> > (just in negated and then 2x non-negated format)?
> >
> > That test is ugly anyway. Why is "tpm_is_firmware_upgrade()" a wrapper
> > function around testing "chip->flags", but then right next to it it
> > tests them explicitly.
> >
> > So if we have to re-do this all, let's re-do it properly. Ok?
> >
> > Thinking about it, I do guess that makes it easier to just send an
> > incremental patch on top.
> >
> >               Linus
> 
> What if I just revert the commit, apply the correct one, and send a PR?

No, stop, please. We have it sorted already. There's a thread with Greg
now about the stable backport you can weigh in on, though. Please just
read all your emails from the last week, and then it'll be clear what's
up. Do that catchup before taking further actions, please.

Jason

  reply	other threads:[~2023-08-10 15:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 18:24 [PATCH v3] tpm: Disable RNG for all AMD fTPMs Mario Limonciello
2023-08-04 13:28 ` Jason A. Donenfeld
2023-08-04 23:06   ` Jarkko Sakkinen
2023-08-04 22:54 ` Jarkko Sakkinen
2023-08-04 23:21   ` Mario Limonciello
2023-08-04 23:39     ` Jarkko Sakkinen
2023-08-07 22:28       ` Jason A. Donenfeld
2023-08-08  0:15         ` Mario Limonciello
2023-08-08  0:39           ` Jason A. Donenfeld
2023-08-08  3:26             ` Linus Torvalds
2023-08-08 17:19               ` Jason A. Donenfeld
2023-08-09 17:06                 ` Linus Torvalds
2023-08-09 21:35                   ` Jason A. Donenfeld
2023-08-10 15:37                   ` Jarkko Sakkinen
2023-08-10 15:06               ` Jarkko Sakkinen
2023-08-10 15:14                 ` Jason A. Donenfeld [this message]
2023-08-10 15:04           ` Jarkko Sakkinen
2023-08-10 14:42         ` Jarkko Sakkinen
2023-08-10 14:45           ` Limonciello, Mario

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZNT+wvrX/hywsA4M@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=daniil.stas@posteo.net \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mario.limonciello@amd.com \
    --cc=peterhuewe@gmx.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox