Skip to content
Commit e569cd17 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chen Ridong
Browse files

thermal: core: prevent potential string overflow

stable inclusion
from stable-v5.10.201
commit 3f795fb35c2d8a637efe76b4518216c9319b998c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RFK5
CVE: CVE-2023-52868

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3f795fb35c2d8a637efe76b4518216c9319b998c



--------------------------------

[ Upstream commit c99626092efca3061b387043d4a7399bf75fbdd5 ]

The dev->id value comes from ida_alloc() so it's a number between zero
and INT_MAX.  If it's too high then these sprintf()s will overflow.

Fixes: 5c14409183e3 ("the generic thermal sysfs driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
parent 80ab23a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment