]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: cpia2_usb: first wake up, then free in disconnect
authorOliver Neukum <oneukum@suse.com>
Thu, 9 May 2019 08:57:09 +0000 (04:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Aug 2019 07:32:01 +0000 (09:32 +0200)
commit3566a98e59b5cb19829d21bfe18cd396812ce15e
tree0de9dd9c2c623778a5031ab9a30bd5cdc78d9223
parent3abe1639de0b88ee4a78ea43b8fa1d98c302e647
media: cpia2_usb: first wake up, then free in disconnect

commit eff73de2b1600ad8230692f00bc0ab49b166512a upstream.

Kasan reported a use after free in cpia2_usb_disconnect()
It first freed everything and then woke up those waiting.
The reverse order is correct.

Fixes: 6c493f8b28c67 ("[media] cpia2: major overhaul to get it in a working state again")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: syzbot+0c90fc937c84f97d0aa6@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/cpia2/cpia2_usb.c