Skip to content
Commit 47aa8fcd authored by Ricardo B. Marliere's avatar Ricardo B. Marliere Committed by Greg Kroah-Hartman
Browse files

media: pvrusb2: fix use after free on context disconnection

[ Upstream commit ded85b0c

 ]

Upon module load, a kthread is created targeting the
pvr2_context_thread_func function, which may call pvr2_context_destroy
and thus call kfree() on the context object. However, that might happen
before the usb hub_event handler is able to notify the driver. This
patch adds a sanity check before the invalid read reported by syzbot,
within the context disconnection call stack.

Reported-and-tested-by: default avatar <syzbot+621409285c4156a009b3@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/all/000000000000a02a4205fff8eb92@google.com/

Fixes: e5be15c6

 ("V4L/DVB (7711): pvrusb2: Fix race on module unload")
Signed-off-by: default avatarRicardo B. Marliere <ricardo@marliere.net>
Acked-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f6a35c21
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment