[RFC PATCH 7/8] KEYS: Reject @datalen values over INT_MAX

David Howells dhowells at redhat.com
Mon Oct 19 15:43:27 UTC 2026


Jarkko Sakkinen <jarkko at kernel.org> wrote:

> -	int delta = (int)datalen - key->datalen;
> +	int delta;
>  	int ret = 0;
>  
>  	key_check(key);
>  
> +	if (datalen > INT_MAX)
> +		return -EINVAL;
> +
> +	delta = (int)datalen - key->datalen;
> +

You don't actually need to move the subtraction.

But apart from that:

Signed-off-by: David Howells <dhowells at redhat.com>




More information about the Linux-security-module-archive mailing list