Re: [RFC PATCH 5/8] KEYS: Prevent overflow of quota in key_alloc()

From: Jarkko Sakkinen

Date: Mon Oct 19 2026 - 14:01:41 EST


On Mon, Oct 19, 2026 at 04:40:47PM +0100, David Howells wrote:
> Jarkko Sakkinen <jarkko@xxxxxxxxxx> wrote:
>
> > - if (desclen > U16_MAX)
>
> This should also be KEY_MAX_DESC_SIZE.
>
> > + if (desclen > U16_MAX || type->def_datalen > INT_MAX - desclen - 1)
>
> That looks awkward, but I can see why you did it.
>
> Reviewed-by: David Howells <dhowells@xxxxxxxxxx>
>

Do you mind if I do search-replace and apply these with
KEY_MAX_DESC_SIZE fixup?

Br, Jarkko