]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: drbg - Fix misaligned writes in CTR_DRBG and HASH_DRBG
authorEric Biggers <ebiggers@kernel.org>
Mon, 20 Apr 2026 06:33:46 +0000 (23:33 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 7 May 2026 08:09:59 +0000 (16:09 +0800)
commitddc4dedb9ba3c8eecbc8c050fffd46d1b7e75c21
treed9873c4421300070bee77c16161a86e3a9148e1c
parent39a31ad9e2a5ed7e9c9c6f711dca96c8c8f5f26b
crypto: drbg - Fix misaligned writes in CTR_DRBG and HASH_DRBG

drbg_cpu_to_be32() is being used to do a plain write to a byte array,
which doesn't have any alignment guarantee.  This can cause a misaligned
write.  Replace it with the correct function, put_unaligned_be32().

Fixes: 72f3e00dd67e ("crypto: drbg - replace int2byte with cpu_to_be")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/df_sp80090a.c
crypto/drbg.c
include/crypto/internal/drbg.h