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:Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Chen Ridong <chenridong@huawei.com>
Loading
Please sign in to comment