All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Albert Briscoe <albertsbriscoe@gmail.com>,
	Zqiang <qiang.zhang@windriver.com>,
	Felipe Balbi <balbi@kernel.org>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: function: use after free in printer_close()
Date: Tue, 22 Nov 2022 10:00:27 +0300	[thread overview]
Message-ID: <Y3xzi389jS0PmEBA@kadam> (raw)
In-Reply-To: <b7dcf498-51ea-3aaf-211f-09fa59c38768@collabora.com>

On Mon, Nov 21, 2022 at 04:32:52PM +0100, Andrzej Pietrasiewicz wrote:
> Hi Dan,
> 
> I'm fine with either symmetrically removing the DBG() from "printer_open()"
> or with this version of the patch.
> 
> It seems to me that this version better fits "fixing UAF", though.
> Whether the driver is too verbose is another matter, and if it is,
> it deserves its own patch because DBG() invocations are sprinkled
> here and there.

It is too verbose, but I'm trying to cut my kernel work to an hour a day
and then all day Friday so I don't have time to clean to do clean up
work.  A UAF is sort of high value but clean up is endless.

I obviously considered this as v1 but thought deleting was better.  I
still do.  :)  But it's not worth spending time on.

> 
> W dniu 21.11.2022 o 15:44, Dan Carpenter pisze:
> > The printer_dev_free() function frees "dev" but then it is dereferenced
> > by the debug code on the next line.  Flip the order to avoid the use after
> > free.
> > 
> > Fixes: e8d5f92b8d30 ("usb: gadget: function: printer: fix use-after-free in __lock_acquire")
> > Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> Acked-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

Thanks!

regards,
dan carpenter


  reply	other threads:[~2022-11-22  7:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 14:44 [PATCH] usb: gadget: function: use after free in printer_close() Dan Carpenter
2022-11-21 15:32 ` Andrzej Pietrasiewicz
2022-11-22  7:00   ` Dan Carpenter [this message]
2022-11-22  9:49     ` Andrzej Pietrasiewicz
2022-11-22 14:16       ` [PATCH] usb: gadget: function: Simplify error messaging in printer open/close Andrzej Pietrasiewicz
2022-11-22 15:54         ` Greg Kroah-Hartman
2022-11-23 11:07           ` [PATCH] usb: gadget: function: Simplify diagnostic messaging in printer Andrzej Pietrasiewicz
  -- strict thread matches above, loose matches on Subject: below --
2022-11-18 11:47 [PATCH] usb: gadget: function: use after free in printer_close() Dan Carpenter
2022-11-21 12:37 ` 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=Y3xzi389jS0PmEBA@kadam \
    --to=error27@gmail.com \
    --cc=albertsbriscoe@gmail.com \
    --cc=andrzej.p@collabora.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 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.