From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+0434ac83f907a1dbdd1e@syzkaller.appspotmail.com
Subject: Re: [PATCH v3] Input: powermate - fix use-after-free in powermate_config_complete
Date: Fri, 13 Oct 2023 20:13:16 -0700 [thread overview]
Message-ID: <ZSoHTMQSa17OBzOw@google.com> (raw)
In-Reply-To: <20230916-topic-powermate_use_after_free-v3-1-64412b81a7a2@gmail.com>
On Wed, Oct 04, 2023 at 04:36:13PM +0200, Javier Carrasco wrote:
> syzbot has found a use-after-free bug [1] in the powermate driver. This
> happens when the device is disconnected, which leads to a memory free
> from the powermate_device struct.
> When an asynchronous control message completes after the kfree and its
> callback is invoked, the lock does not exist anymore and hence the bug.
>
> Use usb_kill_urb() on pm->config to cancel any in-progress requests upon
> device disconnection.
>
> [1] https://syzkaller.appspot.com/bug?extid=0434ac83f907a1dbdd1e
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> Reported-by: syzbot+0434ac83f907a1dbdd1e@syzkaller.appspotmail.com
Applied, thank you.
--
Dmitry
prev parent reply other threads:[~2023-10-14 3:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 14:36 [PATCH v3] Input: powermate - fix use-after-free in powermate_config_complete Javier Carrasco
2023-10-14 3:13 ` Dmitry Torokhov [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=ZSoHTMQSa17OBzOw@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+0434ac83f907a1dbdd1e@syzkaller.appspotmail.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