Skip to content
Commit d953e0e8 authored by George Spelvin's avatar George Spelvin Committed by Greg Kroah-Hartman
Browse files

pps: Fix a use-after free bug when unregistering a source.



Remove the cdev from the system (with cdev_del) *before* deallocating it
(in pps_device_destruct, called via kobject_put from device_destroy).

Also prevent deallocating a device with open file handles.

A better long-term fix is probably to remove the cdev from the pps_device
entirely, and instead have all devices reference one global cdev.  Then
the deallocation ordering becomes simpler.

But that's more complex and invasive change, so we leave that
for later.

Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03a7ffe4
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