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)
committerHelge Deller <deller@gmx.de>
Sat, 8 Oct 2022 13:20:09 +0000 (15:20 +0200)
commit5610bcfe8693c02e2e4c8b31427f1bdbdecc839c
tree0c333e5ee6640fb5f8a318194b49e4348c40d0ca
parente69dade8a4cfe49f3f3af90d966dd34b67721d26
fbdev: smscufx: Fix use-after-free in ufx_ops_open()

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>
drivers/video/fbdev/smscufx.c