]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: aesni - ctr_crypt() use min() instead of min_t()
authorDavid Laight <david.laight.linux@gmail.com>
Wed, 19 Nov 2025 22:41:06 +0000 (22:41 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 24 Nov 2025 09:43:40 +0000 (17:43 +0800)
commit6c5d5b6dc5eb966e86a92e6587ccca1ec1e392e1
treebb854f885ceb85ce5a094c9e1658dc6a79b5071d
parent680cd3e28c62b2d753840c78221357e5ac9c128b
crypto: aesni - ctr_crypt() use min() instead of min_t()

min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
and so cannot discard significant bits.

In this case the 'unsigned long' value is small enough that the result
is ok.

Detected by an extra check added to min_t().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c