* [PATCH] tpm: require to compile as part of the kernel
@ 2018-06-29 15:10 Jarkko Sakkinen
2018-06-29 15:31 ` Jason Gunthorpe
0 siblings, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2018-06-29 15:10 UTC (permalink / raw)
To: linux-integrity
Cc: linux-security-module, Jarkko Sakkinen, Peter Huewe,
Jason Gunthorpe, Arnd Bergmann, Greg Kroah-Hartman,
Winkler, Tomas, Azhar Shaikh, Stefan Berger, open list
Do not allow to compile TPM core as a module. TPM defines a root of
trust for integrity and keyring subsystems and should be always
available and not be loaded from the user space. There is no a
reasonable use case for a loadable module existing.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
drivers/char/tpm/Kconfig | 2 +-
include/linux/tpm.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index 18c81cbe4704..9728771aecbd 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -3,7 +3,7 @@
#
menuconfig TCG_TPM
- tristate "TPM Hardware Support"
+ bool "TPM Hardware Support"
depends on HAS_IOMEM
select SECURITYFS
select CRYPTO
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 4609b94142d4..cefa61b12891 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -50,8 +50,7 @@ struct tpm_class_ops {
void (*clk_enable)(struct tpm_chip *chip, bool value);
};
-#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
-
+#if defined(CONFIG_TCG_TPM)
extern int tpm_is_tpm2(struct tpm_chip *chip);
extern int tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf);
extern int tpm_pcr_extend(struct tpm_chip *chip, int pcr_idx, const u8 *hash);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: require to compile as part of the kernel
2018-06-29 15:10 [PATCH] tpm: require to compile as part of the kernel Jarkko Sakkinen
@ 2018-06-29 15:31 ` Jason Gunthorpe
2018-06-29 17:43 ` Jarkko Sakkinen
2018-06-29 17:47 ` Jarkko Sakkinen
0 siblings, 2 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2018-06-29 15:31 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: linux-integrity, linux-security-module, Peter Huewe,
Arnd Bergmann, Greg Kroah-Hartman, Winkler, Tomas, Azhar Shaikh,
Stefan Berger, open list
On Fri, Jun 29, 2018 at 06:10:02PM +0300, Jarkko Sakkinen wrote:
> Do not allow to compile TPM core as a module. TPM defines a root of
> trust for integrity and keyring subsystems and should be always
> available and not be loaded from the user space. There is no a
> reasonable use case for a loadable module existing.
>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
> drivers/char/tpm/Kconfig | 2 +-
> include/linux/tpm.h | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
This doesn't really make sense..
The kconfig method is that if IMA requires TPM it should declare so
and TPM will become non-modular because IMA is non-modular.
There are lots of legitimate use cases for TPM that don't involve IMA
or keyring.
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 18c81cbe4704..9728771aecbd 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -3,7 +3,7 @@
> #
>
> menuconfig TCG_TPM
> - tristate "TPM Hardware Support"
> + bool "TPM Hardware Support"
> depends on HAS_IOMEM
> select SECURITYFS
> select CRYPTO
> diff --git a/include/linux/tpm.h b/include/linux/tpm.h
> index 4609b94142d4..cefa61b12891 100644
> --- a/include/linux/tpm.h
> +++ b/include/linux/tpm.h
> @@ -50,8 +50,7 @@ struct tpm_class_ops {
> void (*clk_enable)(struct tpm_chip *chip, bool value);
> };
>
> -#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
> -
> +#if defined(CONFIG_TCG_TPM)
Huh. This new version is certainly right
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: require to compile as part of the kernel
2018-06-29 15:31 ` Jason Gunthorpe
@ 2018-06-29 17:43 ` Jarkko Sakkinen
2018-06-29 18:11 ` Jason Gunthorpe
2018-06-29 17:47 ` Jarkko Sakkinen
1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2018-06-29 17:43 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-integrity, linux-security-module, Peter Huewe,
Arnd Bergmann, Greg Kroah-Hartman, Winkler, Tomas, Azhar Shaikh,
Stefan Berger, open list
On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote:
> On Fri, Jun 29, 2018 at 06:10:02PM +0300, Jarkko Sakkinen wrote:
> > Do not allow to compile TPM core as a module. TPM defines a root of
> > trust for integrity and keyring subsystems and should be always
> > available and not be loaded from the user space. There is no a
> > reasonable use case for a loadable module existing.
> >
> > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > ---
> > drivers/char/tpm/Kconfig | 2 +-
> > include/linux/tpm.h | 3 +--
> > 2 files changed, 2 insertions(+), 3 deletions(-)
>
> This doesn't really make sense..
>
> The kconfig method is that if IMA requires TPM it should declare so
> and TPM will become non-modular because IMA is non-modular.
>
> There are lots of legitimate use cases for TPM that don't involve IMA
> or keyring.
In what context would it make sense to have TPM core as a module? I
forgot to add RFC tag this patch. Did not meant to push it to
mainline but more to rise up the discussion.
/Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: require to compile as part of the kernel
2018-06-29 15:31 ` Jason Gunthorpe
2018-06-29 17:43 ` Jarkko Sakkinen
@ 2018-06-29 17:47 ` Jarkko Sakkinen
2018-06-29 18:09 ` Jason Gunthorpe
1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2018-06-29 17:47 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: linux-integrity, linux-security-module, Peter Huewe,
Arnd Bergmann, Greg Kroah-Hartman, Winkler, Tomas, Azhar Shaikh,
Stefan Berger, open list
On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote:
> > -#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
> > -
> > +#if defined(CONFIG_TCG_TPM)
>
> Huh. This new version is certainly right
Hmm...
If the option is kept as tristate, shouldn't this be actually:
#if defined(CONFIG_TCG_TPM) && !defined(CONFIG_TCG_TPM_MODULE)
?
/Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: require to compile as part of the kernel
2018-06-29 17:47 ` Jarkko Sakkinen
@ 2018-06-29 18:09 ` Jason Gunthorpe
0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2018-06-29 18:09 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: linux-integrity, linux-security-module, Peter Huewe,
Arnd Bergmann, Greg Kroah-Hartman, Winkler, Tomas, Azhar Shaikh,
Stefan Berger, open list
On Fri, Jun 29, 2018 at 08:47:43PM +0300, Jarkko Sakkinen wrote:
> On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote:
> > > -#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
> > > -
> > > +#if defined(CONFIG_TCG_TPM)
> >
> > Huh. This new version is certainly right
>
> Hmm...
>
> If the option is kept as tristate, shouldn't this be actually:
>
> #if defined(CONFIG_TCG_TPM) && !defined(CONFIG_TCG_TPM_MODULE)
>
> ?
Er, yes, it should be writte as
#if IS_ENABLED(CONFIG_TCG_TPM)
these days
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: require to compile as part of the kernel
2018-06-29 17:43 ` Jarkko Sakkinen
@ 2018-06-29 18:11 ` Jason Gunthorpe
0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2018-06-29 18:11 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: linux-integrity, linux-security-module, Peter Huewe,
Arnd Bergmann, Greg Kroah-Hartman, Winkler, Tomas, Azhar Shaikh,
Stefan Berger, open list
On Fri, Jun 29, 2018 at 08:43:28PM +0300, Jarkko Sakkinen wrote:
> On Fri, Jun 29, 2018 at 09:31:41AM -0600, Jason Gunthorpe wrote:
> > On Fri, Jun 29, 2018 at 06:10:02PM +0300, Jarkko Sakkinen wrote:
> > > Do not allow to compile TPM core as a module. TPM defines a root of
> > > trust for integrity and keyring subsystems and should be always
> > > available and not be loaded from the user space. There is no a
> > > reasonable use case for a loadable module existing.
> > >
> > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > drivers/char/tpm/Kconfig | 2 +-
> > > include/linux/tpm.h | 3 +--
> > > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > This doesn't really make sense..
> >
> > The kconfig method is that if IMA requires TPM it should declare so
> > and TPM will become non-modular because IMA is non-modular.
> >
> > There are lots of legitimate use cases for TPM that don't involve IMA
> > or keyring.
>
> In what context would it make sense to have TPM core as a module? I
> forgot to add RFC tag this patch. Did not meant to push it to
> mainline but more to rise up the discussion.
The usual reasons for modules, embedded that wants minimize kernel
image size to minimize boot time - load modules after the system has
started.. Developers that wish to use module-reload to test the code
they are working on, etc.
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-29 18:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-29 15:10 [PATCH] tpm: require to compile as part of the kernel Jarkko Sakkinen
2018-06-29 15:31 ` Jason Gunthorpe
2018-06-29 17:43 ` Jarkko Sakkinen
2018-06-29 18:11 ` Jason Gunthorpe
2018-06-29 17:47 ` Jarkko Sakkinen
2018-06-29 18:09 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).