From: Dipen Patel <dipenp@nvidia.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Cc: jonathanh@nvidia.com, thierry.reding@gmail.com
Subject: Re: [PATCH -next] hte: fix possible use-after-free in tegra_hte_test_remove()
Date: Fri, 6 May 2022 11:09:39 -0700 [thread overview]
Message-ID: <6cf909e4-33ca-5cb2-f70b-bd8e8373a929@nvidia.com> (raw)
In-Reply-To: <20220506084851.3503635-1-yangyingliang@huawei.com>
Reviewed-by: Dipen Patel
Acked-by: Dipen Patel
On 5/6/22 1:48 AM, Yang Yingliang wrote:
> 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: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/hte/hte-tegra194-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c
> index bc3ab18dfdc5..f69a274a7d8d 100644
> --- a/drivers/hte/hte-tegra194-test.c
> +++ b/drivers/hte/hte-tegra194-test.c
> @@ -220,7 +220,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;
> }
prev parent reply other threads:[~2022-05-06 18:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 8:48 Yang Yingliang
2022-05-06 18:09 ` Dipen Patel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6cf909e4-33ca-5cb2-f70b-bd8e8373a929@nvidia.com \
--to=dipenp@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®