stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size()
@ 2019-04-23 12:58 Jarkko Sakkinen
  2019-04-23 14:57 ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2019-04-23 12:58 UTC (permalink / raw)
  To: stable; +Cc: Yue Haibing, Jarkko Sakkinen, James Morris

From: Yue Haibing <yuehaibing@huawei.com>

calc_tpm2_event_size() has an invalid signature because
it returns a 'size_t' where as its signature says that
it returns 'int'.

Cc: <stable@vger.kernel.org>
Fixes: 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")
Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
---
backport v5.0.8
fixed compilation issue
 drivers/char/tpm/eventlog/tpm2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/eventlog/tpm2.c b/drivers/char/tpm/eventlog/tpm2.c
index d8b77133a83a..f824563fc28d 100644
--- a/drivers/char/tpm/eventlog/tpm2.c
+++ b/drivers/char/tpm/eventlog/tpm2.c
@@ -37,8 +37,8 @@
  *
  * Returns size of the event. If it is an invalid event, returns 0.
  */
-static int calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
-				struct tcg_pcr_event *event_header)
+static size_t calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
+				   struct tcg_pcr_event *event_header)
 {
 	struct tcg_efi_specid_event_head *efispecid;
 	struct tcg_event_field *event_field;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size()
@ 2019-04-23 13:05 Jarkko Sakkinen
  2019-04-23 15:05 ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2019-04-23 13:05 UTC (permalink / raw)
  To: stable; +Cc: Yue Haibing, Jarkko Sakkinen, James Morris

From: Yue Haibing <yuehaibing@huawei.com>

commit b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a upstream

calc_tpm2_event_size() has an invalid signature because
it returns a 'size_t' where as its signature says that
it returns 'int'.

Cc: <stable@vger.kernel.org>
Fixes: 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")
Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
---
for v5.0 and v4.19 stable
fixed compilation issue
fixed upstream commit ID
 drivers/char/tpm/eventlog/tpm2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/eventlog/tpm2.c b/drivers/char/tpm/eventlog/tpm2.c
index 1b8fa9de2cac..41b9f6c92da7 100644
--- a/drivers/char/tpm/eventlog/tpm2.c
+++ b/drivers/char/tpm/eventlog/tpm2.c
@@ -37,8 +37,8 @@
  *
  * Returns size of the event. If it is an invalid event, returns 0.
  */
-static int calc_tpm2_event_size(struct tcg_pcr_event2 *event,
-				struct tcg_pcr_event *event_header)
+static size_t calc_tpm2_event_size(struct tcg_pcr_event2 *event,
+				   struct tcg_pcr_event *event_header)
 {
 	struct tcg_efi_specid_event *efispecid;
 	struct tcg_event_field *event_field;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size()
  2019-04-23 12:58 Jarkko Sakkinen
@ 2019-04-23 14:57 ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2019-04-23 14:57 UTC (permalink / raw)
  To: stable; +Cc: Yue Haibing, James Morris

On Tue, Apr 23, 2019 at 03:58:16PM +0300, Jarkko Sakkinen wrote:
> From: Yue Haibing <yuehaibing@huawei.com>
> 
> calc_tpm2_event_size() has an invalid signature because
> it returns a 'size_t' where as its signature says that
> it returns 'int'.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")
> Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Signed-off-by: James Morris <james.morris@microsoft.com>
> ---
> backport v5.0.8
> fixed compilation issue
>  drivers/char/tpm/eventlog/tpm2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/eventlog/tpm2.c b/drivers/char/tpm/eventlog/tpm2.c
> index d8b77133a83a..f824563fc28d 100644
> --- a/drivers/char/tpm/eventlog/tpm2.c
> +++ b/drivers/char/tpm/eventlog/tpm2.c
> @@ -37,8 +37,8 @@
>   *
>   * Returns size of the event. If it is an invalid event, returns 0.
>   */
> -static int calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
> -				struct tcg_pcr_event *event_header)
> +static size_t calc_tpm2_event_size(struct tcg_pcr_event2_head *event,
> +				   struct tcg_pcr_event *event_header)
>  {
>  	struct tcg_efi_specid_event_head *efispecid;
>  	struct tcg_event_field *event_field;
> -- 
> 2.20.1
> 

This was a mistake. Please ignore. Sent another one.

/Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size()
  2019-04-23 13:05 [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size() Jarkko Sakkinen
@ 2019-04-23 15:05 ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2019-04-23 15:05 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: stable, Yue Haibing, James Morris

On Tue, Apr 23, 2019 at 04:05:18PM +0300, Jarkko Sakkinen wrote:
>From: Yue Haibing <yuehaibing@huawei.com>
>
>commit b9d0a85d6b2e76630cfd4c475ee3af4109bfd87a upstream
>
>calc_tpm2_event_size() has an invalid signature because
>it returns a 'size_t' where as its signature says that
>it returns 'int'.
>
>Cc: <stable@vger.kernel.org>
>Fixes: 4d23cc323cdb ("tpm: add securityfs support for TPM 2.0 firmware event log")
>Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
>Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>Signed-off-by: James Morris <james.morris@microsoft.com>

Queued for 5.0 and 4.19, thanks!

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-23 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23 13:05 [PATCH v2] tpm: Fix the type of the return value in calc_tpm2_event_size() Jarkko Sakkinen
2019-04-23 15:05 ` Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2019-04-23 12:58 Jarkko Sakkinen
2019-04-23 14:57 ` Jarkko Sakkinen

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).