public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: Johan Hovold <johan@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] usb: serial: garmin_gps: A possible concurrency use-after-free bug
Date: Thu, 20 Dec 2018 14:46:09 +0100	[thread overview]
Message-ID: <20181220134609.GA27701@localhost> (raw)
In-Reply-To: <8b24e2fc-df9a-8e06-aa49-a27675fd36e9@gmail.com>

On Thu, Dec 20, 2018 at 09:41:16PM +0800, Jia-Ju Bai wrote:
> In drivers/usb/serial/garmin_gps.c,
> the functions garmin_read_bulk_callback() and garmin_write_bulk_callback()
> may be concurrently executed.
> 
> In garmin_write_bulk_callback() on line 969:
>      kfree(urb->transfer_buffer);
> In garmin_read_bulk_callback() on line 1165:
>      unsigned char *data = urb->transfer_buffer;
> Thus, a concurrency use-after-free bug may occur.

No, they operate on different struct urb.

> This possible bug is found by a static analysis tool written by myself.

Seems you need to update your tool. Please also make sure to review its
output before reporting anything.

Thanks,
Johan

  reply	other threads:[~2018-12-20 13:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 13:41 [BUG] usb: serial: garmin_gps: A possible concurrency use-after-free bug Jia-Ju Bai
2018-12-20 13:46 ` Johan Hovold [this message]
2018-12-20 13:48   ` Jia-Ju Bai

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=20181220134609.GA27701@localhost \
    --to=johan@kernel.org \
    --cc=baijiaju1990@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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