]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: virtio_uml: Fix use-after-free after put_device in probe
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 28 Aug 2025 07:00:51 +0000 (15:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:16:42 +0000 (11:16 +0200)
commitc2ff91255e0157b356cff115d8dc3eeb5162edf2
tree385dcdb20a957dad28a6018e582c5bb1353e3cb5
parent856e039ded021c66449cc8aae0ba5d05f564f97e
um: virtio_uml: Fix use-after-free after put_device in probe

[ Upstream commit 7ebf70cf181651fe3f2e44e95e7e5073d594c9c0 ]

When register_virtio_device() fails in virtio_uml_probe(),
the code sets vu_dev->registered = 1 even though
the device was not successfully registered.
This can lead to use-after-free or other issues.

Fixes: 04e5b1fb0183 ("um: virtio: Remove device on disconnect")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/virtio_uml.c