Re: [PATCH] crypto: bcm - Reject requests with too many fragments
From: Praneeth Balasubramanian
Date: Sat Dec 05 2026 - 03:21:52 EST
On Sat, 05 Dec 2026 07:02:46 +0000, sashiko-bot@xxxxxxxxxx wrote:
> [Severity: Critical]
> Can rx_frag_num still wrap to 0 inside spu_aead_rx_sg_create()?
>
> This check lets rx_frag_num == U8_MAX (255) through, but
> spu_aead_rx_sg_create() takes rx_frag_num as a u8 and increments it again
> when data_padlen is non-zero:
Right, thanks. The check in handle_aead_req() does not count the pad
entry, so the count can still wrap. Please do not apply this version.
v2 makes spu_aead_rx_sg_create() fail with -EINVAL when the pad entry
would not fit, before it allocates. The other sg create helpers do not
add entries on their own.