linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	syzbot <syzbot+784ccb935f9900cc7c9e@syzkaller.appspotmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	andreyknvl@google.com, syzkaller-bugs@googlegroups.com,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-usb@vger.kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] HID: hiddev: Fix race in in hiddev_disconnect()
Date: Wed, 12 Feb 2020 14:47:31 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2002121447190.3144@cbobk.fhfr.pm> (raw)
In-Reply-To: <20200115174628.zxpxbpa6bwspjajg@kili.mountain>

On Wed, 15 Jan 2020, Dan Carpenter wrote:

> Syzbot reports that "hiddev" is used after it's free in hiddev_disconnect().
> The hiddev_disconnect() function sets "hiddev->exist = 0;" so
> hiddev_release() can free it as soon as we drop the "existancelock"
> lock.  This patch moves the mutex_unlock(&hiddev->existancelock) until
> after we have finished using it.
> 
> Reported-by: syzbot+784ccb935f9900cc7c9e@syzkaller.appspotmail.com
> Fixes: 7f77897ef2b6 ("HID: hiddev: fix potential use-after-free")
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to for-5.6/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs


      reply	other threads:[~2020-02-12 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 13:04 KASAN: use-after-free Write in hiddev_disconnect syzbot
2020-01-14 15:24 ` Dan Carpenter
2020-01-14 16:06   ` Alan Stern
2020-01-15 17:46     ` [PATCH] HID: hiddev: Fix race in in hiddev_disconnect() Dan Carpenter, syzbot
2020-02-12 13:47       ` Jiri Kosina [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=nycvar.YFH.7.76.2002121447190.3144@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=andreyknvl@google.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+784ccb935f9900cc7c9e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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).