]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: ims-pcu - check record size in ims_pcu_flash_firmware()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 30 May 2025 23:13:32 +0000 (16:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:29 +0000 (11:07 +0100)
commit8e03f1c7d50343bf21da54873301bc4fa647479f
treefb0a3469fba5b730088592395a4fc00ca005dd7f
parent74088456b034ca0b32d45d270caae4dbb73e129e
Input: ims-pcu - check record size in ims_pcu_flash_firmware()

commit a95ef0199e80f3384eb992889322957d26c00102 upstream.

The "len" variable comes from the firmware and we generally do
trust firmware, but it's always better to double check.  If the "len"
is too large it could result in memory corruption when we do
"memcpy(fragment->data, rec->data, len);"

Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/131fd1ae92c828ee9f4fa2de03d8c210ae1f3524.1748463049.git.dan.carpenter@linaro.org
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/misc/ims-pcu.c