From: Dan Carpenter <error27@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Albert Briscoe <albertsbriscoe@gmail.com>,
Felipe Balbi <balbi@kernel.org>,
Zqiang <qiang.zhang@windriver.com>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] usb: gadget: function: use after free in printer_close()
Date: Fri, 18 Nov 2022 14:47:12 +0300 [thread overview]
Message-ID: <Y3dwwNlBoS13VcIR@kili> (raw)
The printer_dev_free() function frees "dev" but then it is dereferenced
by the debug code on the next line. The debug printk only prints the
function name so it's probably okay to just delete it.
Fixes: e8d5f92b8d30 ("usb: gadget: function: printer: fix use-after-free in __lock_acquire")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/usb/gadget/function/f_printer.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index a881c69b1f2b..7354bfe1e682 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -382,7 +382,6 @@ printer_close(struct inode *inode, struct file *fd)
spin_unlock_irqrestore(&dev->lock, flags);
kref_put(&dev->kref, printer_dev_free);
- DBG(dev, "printer_close\n");
return 0;
}
--
2.35.1
next reply other threads:[~2022-11-18 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 11:47 Dan Carpenter [this message]
2022-11-21 12:37 ` [PATCH] usb: gadget: function: use after free in printer_close() Andrzej Pietrasiewicz
-- strict thread matches above, loose matches on Subject: below --
2022-11-21 14:44 Dan Carpenter
2022-11-21 15:32 ` Andrzej Pietrasiewicz
2022-11-22 7:00 ` Dan Carpenter
2022-11-22 9:49 ` Andrzej Pietrasiewicz
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=Y3dwwNlBoS13VcIR@kili \
--to=error27@gmail.com \
--cc=albertsbriscoe@gmail.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=qiang.zhang@windriver.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;
as well as URLs for NNTP newsgroup(s).