]> git.baikalelectronics.ru Git - kernel.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:22:16 +0000 (13:22 +0200)
commit80761a32af320978440c062f882731ad373f3857
tree574f03f1b98aaa8af8381e6f741f8cbcb97b8015
parenta2cc6f6bb5c62d723dab56334808e257ed55bf21
fbdev: smscufx: Fix use-after-free in ufx_ops_open()

commit bd7132bd3b0904d5be1c55f9faa22be32627c466 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