]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HSI: core: Fix return freed object in hsi_new_client
authorChengfeng Ye <cyeaa@connect.ust.hk>
Fri, 5 Nov 2021 13:45:07 +0000 (06:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 08:04:24 +0000 (09:04 +0100)
commit7a7afa8f446d00bc53c34c8e4170140ab58bc8a8
treeb7f8b208aad66d68eba7e0c112f3354ef8f3380e
parenta7f833eadbe312f8dbd157d2c6ec85bde2e084da
HSI: core: Fix return freed object in hsi_new_client

[ Upstream commit a1ee1c08fcd5af03187dcd41dcab12fd5b379555 ]

cl is freed on error of calling device_register, but this
object is return later, which will cause uaf issue. Fix it
by return NULL on error.

Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hsi/hsi_core.c