mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: jarkko@kernel.org, peterhuewe@gmx.de,
	linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org,
	Jason@zx2c4.com, dragonn@op.pl
Subject: Re: [PATCH 3/3] tpm: Drop CONFIG_HW_RANDOM_TPM
Date: Thu, 3 Aug 2023 06:45:33 -0500	[thread overview]
Message-ID: <7309421c-b373-19da-33eb-8940ac8f06d4@amd.com> (raw)
In-Reply-To: <dcbf7a17-67e3-d97d-bd18-9b0bd917a6cf@molgen.mpg.de>

On 8/3/23 02:22, Paul Menzel wrote:
> Dear Mario,
> 
> 
> Thank you for the patch.
> 
> Am 03.08.23 um 03:50 schrieb Mario Limonciello:
>> As the behavior of whether a TPM is registered for hwrng can be 
>> controlled
>> by command line, drop the kernel configuration option.
> 
> Shouldn’t this be left in to be able to set the default without having 
> to change the Linux kernel command line?
> 
It's the same thing as these commits:

b9b01a5625b5a ("random: use random.trust_{bootloader,cpu} command line 
option only")

d97c68d178fbf ("random: treat bootloader trust toggle the same way as 
cpu trust toggle")

So it matches the behavior of those.

> 
> Kind regards
> 
> Paul
> 
> 
>> Cc: Mateusz Schyboll <dragonn@op.pl>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/char/tpm/Kconfig    | 11 -----------
>>   drivers/char/tpm/tpm-chip.c |  6 +++---
>>   2 files changed, 3 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
>> index 927088b2c3d3f..69aaa730dc208 100644
>> --- a/drivers/char/tpm/Kconfig
>> +++ b/drivers/char/tpm/Kconfig
>> @@ -27,17 +27,6 @@ menuconfig TCG_TPM
>>   if TCG_TPM
>> -config HW_RANDOM_TPM
>> -    bool "TPM HW Random Number Generator support"
>> -    depends on TCG_TPM && HW_RANDOM && !(TCG_TPM=y && HW_RANDOM=m)
>> -    default y
>> -    help
>> -      This setting exposes the TPM's Random Number Generator as a hwrng
>> -      device. This allows the kernel to collect randomness from the 
>> TPM at
>> -      boot, and provides the TPM randomines in /dev/hwrng.
>> -
>> -      If unsure, say Y.
>> -
>>   config TCG_TIS_CORE
>>       tristate
>>       help
>> diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
>> index 8fb42232bd7a5..0d69335743469 100644
>> --- a/drivers/char/tpm/tpm-chip.c
>> +++ b/drivers/char/tpm/tpm-chip.c
>> @@ -533,7 +533,7 @@ static int tpm_add_hwrng(struct tpm_chip *chip)
>>       if (!trust_tpm)
>>           chip->flags |= TPM_CHIP_FLAG_HWRNG_DISABLED;
>> -    if (!IS_ENABLED(CONFIG_HW_RANDOM_TPM) || 
>> tpm_is_firmware_upgrade(chip) ||
>> +    if (tpm_is_firmware_upgrade(chip) ||
>>           chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED)
>>           return 0;
>> @@ -639,7 +639,7 @@ int tpm_chip_register(struct tpm_chip *chip)
>>       return 0;
>>   out_hwrng:
>> -    if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && 
>> !tpm_is_firmware_upgrade(chip) &&
>> +    if (!tpm_is_firmware_upgrade(chip) &&
>>           !(chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED))
>>           hwrng_unregister(&chip->hwrng);
>>   out_ppi:
>> @@ -665,7 +665,7 @@ EXPORT_SYMBOL_GPL(tpm_chip_register);
>>   void tpm_chip_unregister(struct tpm_chip *chip)
>>   {
>>       tpm_del_legacy_sysfs(chip);
>> -    if (IS_ENABLED(CONFIG_HW_RANDOM_TPM) && 
>> !tpm_is_firmware_upgrade(chip) &&
>> +    if (!tpm_is_firmware_upgrade(chip) &&
>>           !(chip->flags & TPM_CHIP_FLAG_HWRNG_DISABLED))
>>           hwrng_unregister(&chip->hwrng);
>>       tpm_bios_log_teardown(chip);


  parent reply	other threads:[~2023-08-03 11:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  1:50 [PATCH 0/3] More changes related to TPM RNG handling Mario Limonciello
2023-08-03  1:50 ` [PATCH 1/3] tpm: Add a missing check for TPM_CHIP_FLAG_HWRNG_DISABLED Mario Limonciello
2023-08-03  8:59   ` Jarkko Sakkinen
2023-08-03 11:35     ` Mario Limonciello
2023-08-03 13:50       ` Jason A. Donenfeld
2023-08-04 22:52         ` Jarkko Sakkinen
2023-08-03  1:50 ` [PATCH 2/3] tpm: Add command line for not trusting tpm for RNG Mario Limonciello
2023-08-03 13:42   ` Jason A. Donenfeld
2023-08-03  1:50 ` [PATCH 3/3] tpm: Drop CONFIG_HW_RANDOM_TPM Mario Limonciello
2023-08-03  7:22   ` Paul Menzel
2023-08-03  9:03     ` Jarkko Sakkinen
2023-08-03 11:45     ` Mario Limonciello [this message]
2023-08-03  9:01   ` Jarkko Sakkinen

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=7309421c-b373-19da-33eb-8940ac8f06d4@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Jason@zx2c4.com \
    --cc=dragonn@op.pl \
    --cc=jarkko@kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=pmenzel@molgen.mpg.de \
    /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

all inboxes | Powered by JetHome®