From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Jeffy Chen <jeffy.chen@rock-chips.com>, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org,
Mathias Nyman <mathias.nyman@intel.com>
Subject: Re: [PATCH v2] xhci: Cleanup current_cmd in xhci_cleanup_command_queue()
Date: Mon, 2 Oct 2017 14:48:59 +0300 [thread overview]
Message-ID: <59D227AB.30906@linux.intel.com> (raw)
In-Reply-To: <20170929110757.25345-1-jeffy.chen@rock-chips.com>
On 29.09.2017 14:07, Jeffy Chen wrote:
> KASAN reported use-after-free bug when xhci host controller died:
> [ 176.952537] BUG: KASAN: use-after-free in xhci_handle_command_timeout+0x68/0x224
> [ 176.960846] Write of size 4 at addr ffffffc0cbb01608 by task kworker/3:3/1680
> ...
> [ 177.180644] Freed by task 0:
> [ 177.183882] kasan_slab_free+0x90/0x15c
> [ 177.188194] kfree+0x114/0x28c
> [ 177.191630] xhci_cleanup_command_queue+0xc8/0xf8
> [ 177.196916] xhci_hc_died+0x84/0x358
>
> Problem here is that when the cmd_timer fired, it would try to access
> current_cmd while the command queue is already freed by xhci_hc_died().
>
> Cleanup current_cmd in xhci_cleanup_command_queue() to avoid that.
>
> Fixes: d9f11ba9f107 ("xhci: Rework how we handle unresponsive or hoptlug removed hosts")
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
>
>
Thanks, adding patch to queue
-Mathias
prev parent reply other threads:[~2017-10-02 11:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 11:07 [PATCH v2] xhci: Cleanup current_cmd in xhci_cleanup_command_queue() Jeffy Chen
2017-10-02 11:48 ` Mathias Nyman [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=59D227AB.30906@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeffy.chen@rock-chips.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.