]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fbdev: smscufx: Fix use-after-free in ufx_ops_open()
authorHyunwoo Kim <imv4bel@gmail.com>
Sun, 25 Sep 2022 13:32:43 +0000 (06:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:15:37 +0000 (13:15 +0200)
commit347a969b130c2a496f471f14b354119b82664f0a
tree275205d81e0ef3e4a677cb96a266df07a1d1b9c5
parent691c8290847dcde260e93766b143b4e881fc7176
fbdev: smscufx: Fix use-after-free in ufx_ops_open()

commit 5610bcfe8693c02e2e4c8b31427f1bdbdecc839c upstream.

A race condition may occur if the user physically removes the
USB device while calling open() for this device node.

This is a race condition between the ufx_ops_open() function and
the ufx_usb_disconnect() function, which may eventually result in UAF.

So, add a mutex to the ufx_ops_open() and ufx_usb_disconnect() functions
to avoid race contidion of krefs.

Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/fbdev/smscufx.c