[lvc-project] [PATCH] crypto: bcm/spu2

Fedor Pchelkin pchelkin at ispras.ru
Tue Mar 19 14:19:34 MSK 2024


On Wed, 06. Mar 14:00, Aleksandr Mishin wrote:
> In spu2_dump_omd() value of ptr is increased by ciph_key_len
> instead of hash_iv_len which could lead to going beyond the
> buffer boundaries.
> 
> Fix this bug by changing ciph_key_len to hash_iv_len.
> 
> Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver")
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Aleksandr Mishin <amishin at t-argos.ru>

Александр, спасибо за патч!

Здесь стоит, как вы уже сами писали, тег Fixes поставить прямо над подписью.
А `Found by Linux Verification Center` поставить выше и отделить пустой
строкой. Для примеров смотрите
`git log --grep="Found by Linux Verification Center"`

В остальном, думаю, все отлично.

> ---

Можно опубликовать вторую версию патча [PATCH v2], в комментарии к ней
кратко пометив, чем вторая версия отличается от первой. Комментарий автора к
патчу пишут в этом месте: после `---` и перед началом diff.

Что-то вида:
v1->v2: fix commit message according to the Linux kernel rules

Например, смотрите как здесь [1].

[1]: https://lore.kernel.org/lkml/20240305-runtime_pm_enable-v2-1-a849b74091d1@quicinc.com/

>  drivers/crypto/bcm/spu2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/bcm/spu2.c b/drivers/crypto/bcm/spu2.c
> index 07989bb8c220..3fdc64b5a65e 100644
> --- a/drivers/crypto/bcm/spu2.c
> +++ b/drivers/crypto/bcm/spu2.c
> @@ -495,7 +495,7 @@ static void spu2_dump_omd(u8 *omd, u16 hash_key_len, u16 ciph_key_len,
>  	if (hash_iv_len) {
>  		packet_log("  Hash IV Length %u bytes\n", hash_iv_len);
>  		packet_dump("  hash IV: ", ptr, hash_iv_len);
> -		ptr += ciph_key_len;
> +		ptr += hash_iv_len;
>  	}
>  
>  	if (ciph_iv_len) {
> -- 
> 2.30.2



More information about the lvc-project mailing list