提交 0668e8cc 编写于 作者: Y Yang Yingliang 提交者: Thierry Reding

hte: Fix possible use-after-free in tegra_hte_test_remove()

del_timer() does not wait until the timer handler finishing.
This means that the timer handler may still be running after
the driver's remove function has finished, which would result
in a use-after-free.
Fix it by calling del_timer_sync(), which makes sure the timer
handler has finished.
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NDipen Patel <dipenp@nvidia.com>
Acked-by: NDipen Patel <dipenp@nvidia.com>
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 e0bfb57e
......@@ -219,7 +219,7 @@ static int tegra_hte_test_remove(struct platform_device *pdev)
free_irq(hte.gpio_in_irq, &hte);
gpiod_put(hte.gpio_in);
gpiod_put(hte.gpio_out);
del_timer(&hte.timer);
del_timer_sync(&hte.timer);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册