]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (coretemp) Fix out-of-bounds memory access
authorZhang Rui <rui.zhang@intel.com>
Fri, 2 Feb 2024 09:21:34 +0000 (17:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:42:19 +0000 (08:42 +0100)
commitf0da068c75c20ffc5ba28243ff577531dc2af1fd
tree2fe14f572cb2cafbc8429fc96ce3334c16864200
parent9551de5caa2b97e94ef6ac32ba3f9ec231bd8cb8
hwmon: (coretemp) Fix out-of-bounds memory access

[ Upstream commit 4e440abc894585a34c2904a32cd54af1742311b3 ]

Fix a bug that pdata->cpu_map[] is set before out-of-bounds check.
The problem might be triggered on systems with more than 128 cores per
package.

Fixes: 7108b80a542b ("hwmon/coretemp: Handle large core ID value")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240202092144.71180-2-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: fdaf0c8629d4 ("hwmon: (coretemp) Fix bogus core_id to attr name mapping")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/coretemp.c