aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorGautam Menghani <[email protected]>2022-10-19 06:02:14 +0100
committerMauro Carvalho Chehab <[email protected]>2022-11-25 08:00:45 +0000
commit813ceef062b53d68f296aa3cb944b21a091fabdb (patch)
treeb44f241888a1f804dfe8a68d8b8460ed394ab573 /tools/perf/scripts/python
parenta42f363e6b58d1fc642d6d082dc660be73656ba5 (diff)
media: imon: fix a race condition in send_packet()
The function send_packet() has a race condition as follows: func send_packet() { // do work call usb_submit_urb() mutex_unlock() wait_for_event_interruptible() <-- lock gone mutex_lock() } func vfd_write() { mutex_lock() call send_packet() <- prev call is not completed mutex_unlock() } When the mutex is unlocked and the function send_packet() waits for the call to complete, vfd_write() can start another call, which leads to the "URB submitted while active" warning in usb_submit_urb(). Fix this by removing the mutex_unlock() call in send_packet() and using mutex_lock_interruptible(). Link: https://syzkaller.appspot.com/bug?id=e378e6a51fbe6c5cc43e34f131cc9a315ef0337e Fixes: 21677cfc562a ("V4L/DVB: ir-core: add imon driver") Reported-by: [email protected] Signed-off-by: Gautam Menghani <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions