From: Dongliang Mu <mudongliangabcd@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Dongliang Mu <mudongliangabcd@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Cc: syzbot+9780d2b05ac158d32284@syzkaller.appspotmail.com,
Dmitry Torokhov <dtor@insightbb.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] driver: powermate: kill urb in the disconnect function
Date: Sun, 19 Dec 2021 14:02:15 +0800 [thread overview]
Message-ID: <20211219060241.4125076-1-mudongliangabcd@gmail.com> (raw)
In powermate_disconnect, powermate_pulse_led will invoke
powermate_sync_state and submit one urb with pm as its context.
If powermate disconnect before the execution of complete handler,
the pm will become a dangling pointer and lead to UAF.
Fix this by calling usb_kill_urb(pm->config) in the disconnect function.
Note that, the error handling error does not need to take care of this.
Reported-by: syzbot+9780d2b05ac158d32284@syzkaller.appspotmail.com
Fixes: ba0acb5ee318901 ("Input: move USB miscellaneous devices under drivers/input/misc")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
drivers/input/misc/powermate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index c4e0e1886061..903993469fde 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -424,6 +424,7 @@ static void powermate_disconnect(struct usb_interface *intf)
if (pm) {
pm->requires_update = 0;
usb_kill_urb(pm->irq);
+ usb_kill_urb(pm->config);
input_unregister_device(pm->input);
usb_free_urb(pm->irq);
usb_free_urb(pm->config);
--
2.25.1
next reply other threads:[~2021-12-19 6:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-19 6:02 Dongliang Mu [this message]
2021-12-20 8:19 ` Dmitry Torokhov
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=20211219060241.4125076-1-mudongliangabcd@gmail.com \
--to=mudongliangabcd@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dtor@insightbb.com \
--cc=gregkh@suse.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+9780d2b05ac158d32284@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
all inboxes | Powered by JetHome®