Skip to content
Commit 310862e5 authored by Schspa Shi's avatar Schspa Shi Committed by Greg Kroah-Hartman
Browse files

driver: base: fix UAF when driver_attach failed



When driver_attach(drv); failed, the driver_private will be freed.
But it has been added to the bus, which caused a UAF.

To fix it, we need to delete it from the bus when failed.

Fixes: 190888ac ("driver core: fix possible missing of device probe")
Signed-off-by: default avatarSchspa Shi <schspa@gmail.com>
Link: https://lore.kernel.org/r/20220513112444.45112-1-schspa@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 185b29c6
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