From: Stephen Warren <swarren@wwwdotorg.org>
To: Tuomas Tynkkynen <ttynkkynen@nvidia.com>,
Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: EHCI: tegra: Fix use-after-free in .remove()
Date: Tue, 17 Jun 2014 09:56:47 -0600 [thread overview]
Message-ID: <53A0653F.7090001@wwwdotorg.org> (raw)
In-Reply-To: <1403014660-15509-1-git-send-email-ttynkkynen@nvidia.com>
On 06/17/2014 08:17 AM, Tuomas Tynkkynen wrote:
> The tegra_ehci_hcd structure is located in the private space allocated
> by the core USB code so it must not be accessed after the HCD is
> freed.
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
This seems to be a persistent problem. Witness commit ecc8a0cdca18 "usb:
host: tegra: fix warning messages in ehci_remove". So, I wonder if ...
> @@ -479,10 +479,11 @@ static int tegra_ehci_remove(struct platform_device *pdev)
>
> usb_phy_shutdown(hcd->phy);
> usb_remove_hcd(hcd);
> - usb_put_hcd(hcd);
>
> clk_disable_unprepare(tegra->clk);
>
It's worth putting a comment here:
/* This must be last, since *tegra is part of *hcd */
> + usb_put_hcd(hcd);
> +
> return 0;
> }
Of course, that could be a separate commit if you want.
next prev parent reply other threads:[~2014-06-17 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 14:17 Tuomas Tynkkynen
2014-06-17 14:26 ` Alan Stern
2014-06-17 15:56 ` Stephen Warren [this message]
2014-06-17 19:30 ` Alan Stern
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=53A0653F.7090001@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=ttynkkynen@nvidia.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®