Re: [PATCH v5a 0/5] timers: Use timer_shutdown*() before freeing timers

From: Guenter Roeck
Date: Sun Nov 06 2022 - 12:14:07 EST


On Sun, Nov 06, 2022 at 01:45:35AM -0400, Steven Rostedt wrote:
>
> del_timer_sync() is often called before the object that owns the timer is
> freed. But sometimes there's a race that enables the timer again before it is
> freed and causes a use after free when that timer triggers. This patch set
> adds a new "shutdown" timer state, which is set on the new timer_shutdown()
> API. Once a timer is in this state, it can not be re-armed and if it is, it
> will warn.
>
> The first three patches change existing timer_shutdown() functions used
> locally in ARM and some drivers to better namespace names.
>
> The fourth patch implements the new API.
>
> The fifth patch is now a treewide patch that uses a coccinelle script to
> convert the trivial locations where a del_timer*() is called on a timer of an
> object that is freed immediately afterward (or at least in the same function).
>

Series looks good in my testbed.

Build results:
total: 152 pass: 152 fail: 0
Qemu test results:
total: 500 pass: 500 fail: 0

No runtime warnings reported.

For the series:

Tested-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Guenter