]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mfd: mt6360: Add bounds checking in Regmap read/write call-backs
authorChiYuan Huang <cy_huang@richtek.com>
Thu, 29 Sep 2022 02:00:17 +0000 (10:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 10:26:30 +0000 (11:26 +0100)
commit9a38c997525b0e5630692bb05ac572a776365f3f
treef465c3f0758e85b5cbe4b38fdb2007244609fb42
parente7c9f10c44a8919cd8bbd51b228c84d0caf7d518
mfd: mt6360: Add bounds checking in Regmap read/write call-backs

commit 5f4f94e9f26cca6514474b307b59348b8485e711 upstream.

Fix the potential risk of OOB read if bank index is over the maximum.

Refer to the discussion list for the experiment result on mt6370.
https://lore.kernel.org/all/20220914013345.GA5802@cyhuang-hp-elitebook-840-g3.rt/
If not to check the bound, there is the same issue on mt6360.

Cc: stable@vger.kernel.org
Fixes: 3b0850440a06c (mfd: mt6360: Merge different sub-devices I2C read/write)
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/1664416817-31590-1-git-send-email-u0084500@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/mt6360-core.c