From: George Spelvin Date: Tue, 12 Feb 2013 07:27:20 +0000 (-0500) Subject: pps: Fix a use-after free bug when unregistering a source. X-Git-Tag: v3.2.40~98 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77327a71f9841b7dfa708195d1cb133d4ef4a989;p=pandora-kernel.git pps: Fix a use-after free bug when unregistering a source. commit d953e0e837e65ecc1ddaa4f9560f7925878a0de6 upstream. 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: George Spelvin Acked-by: Rodolfo Giometti Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed