]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mfd: cs42l43: Sanity check firmware size
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 8 May 2026 13:48:04 +0000 (14:48 +0100)
committerLee Jones <lee@kernel.org>
Wed, 17 Jun 2026 10:32:30 +0000 (11:32 +0100)
commitb6ef1a74b3ec254f87a6a3c554fe8f8083ebd37c
tree443bde4777e9ff26a4b09b03ec924f90f7b76613
parent1cd125db9343dde0c521562a02190088dde2bd29
mfd: cs42l43: Sanity check firmware size

Currently the code checks if a firmware was received, however it does
not verify that the firmware size is larger than the firmware header. As
the firmware pointer is dereferenced as a pointer to the header
structure this could lead to an out of bounds memory access. Add the
missing check.

Fixes: ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260508134804.1787461-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/cs42l43.c