[lkml]   [2019]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 3.16 43/72] thermal: Fix use-after-free when unregistering thermal zone device
On Sun, Dec 08, 2019 at 01:53:27PM +0000, Ben Hutchings wrote:
> 3.16.79-rc1 review patch. If anyone has any objections, please let me know.
> ------------------
> From: Ido Schimmel <>
> commit 1851799e1d2978f68eea5d9dff322e121dcf59c1 upstream.
> thermal_zone_device_unregister() cancels the delayed work that polls the
> thermal zone, but it does not wait for it to finish. This is racy with
> respect to the freeing of the thermal zone device, which can result in a
> use-after-free [1].
> Fix this by waiting for the delayed work to finish before freeing the
> thermal zone device. Note that thermal_zone_device_set_polling() is
> never invoked from an atomic context, so it is safe to call
> cancel_delayed_work_sync() that can block.


Wei Wang (copied) found a problem with this patch and fixed it:

I believe you should take both patches to your tree.


 \ /
  Last update: 2019-12-08 17:23    [W:0.194 / U:3.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site