lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02d279b6-a330-9167-8980-6732690861fa@loongson.cn>
Date: Thu, 18 Sep 2025 09:50:51 +0800
From: Qunqin Zhao <zhaoqunqin@...ngson.cn>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Lee Jones <lee@...nel.org>, Yinggang Gu <guyinggang@...ngson.cn>,
 Huacai Chen <chenhuacai@...nel.org>, Peter Huewe <peterhuewe@....de>,
 Jarkko Sakkinen <jarkko@...nel.org>, Jason Gunthorpe <jgg@...pe.ca>,
 linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tpm: loongson: Add bufsiz parameter to
 tpm_loongson_send()


在 2025/9/18 上午1:09, Nathan Chancellor 写道:
> Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> in the .send callback"), as the former change was developed against a
> tree without the latter change. This results in a build error:
>
>    drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t,  size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int,  long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
>       48 |         .send = tpm_loongson_send,
>          |                 ^~~~~~~~~~~~~~~~~
>    drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
>    drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
>       31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
>          |            ^~~~~~~~~~~~~~~~~
>
> Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
> error.

This means a lot. Thanks

Best regards,

Qunqin.

>
> Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
> ---
> This is in Lee's ib-mfd-char-crypto-6.18 [1] so he will need to take it
> but I have CC'd the TPM folks as an FYI.
>
> [1]: https://lore.kernel.org/20250902124205.GL2163762@google.com/
> ---
>   drivers/char/tpm/tpm_loongson.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_loongson.c b/drivers/char/tpm/tpm_loongson.c
> index a4ec23639911..9e50250763d1 100644
> --- a/drivers/char/tpm/tpm_loongson.c
> +++ b/drivers/char/tpm/tpm_loongson.c
> @@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>   	return cmd_ret->data_len;
>   }
>   
> -static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
>   {
>   	struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
>   	struct tpm_loongson_cmd *cmd = tpm_engine->command;
>
> ---
> base-commit: 74fddd5fbab879a7d039d9fb49af923927a64811
> change-id: 20250917-tpm-loongson-add-bufsiz-e43f60016cca
>
> Best regards,
> --
> Nathan Chancellor <nathan@...nel.org>
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ