Skip to content
Commit 0ee7a0a4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Wang Wensheng
Browse files

stm class: Fix a double free in stm_register_device()

stable inclusion
from stable-v4.19.316
commit 6cc30ef8eb6d8f8d6df43152264bbf8835d99931
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA7D3T
CVE: CVE-2024-38627

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



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

[ Upstream commit 3df463865ba42b8f88a590326f4c9ea17a1ce459 ]

The put_device(&stm->dev) call will trigger stm_device_release() which
frees "stm" so the vfree(stm) on the next line is a double free.

Fixes: 389b6699 ("stm class: Fix stm device initialization order")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarAmelie Delaunay <amelie.delaunay@foss.st.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Link: https://lore.kernel.org/r/20240429130119.1518073-2-alexander.shishkin@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 108a0666
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment