lkml.org 
[lkml]   [2021]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[BUG] media: platform: qcom: venus: possible ABBA deadlock in venus_event_notify() and venus_helper_vb2_buf_queue()
Date
Hello,

My static analysis tool reports a possible ABBA deadlock in the venus
driver in Linux 5.10:

venus_event_notify()
  mutex_lock(&core->lock); --> line 37 (Lock A)
  vdec_event_notify() --> via a function pointer
"inst->ops->event_notify(...)"
  vdec_event_change()
    mutex_lock(&inst->lock); --> line 1301 (Lock B)

venus_helper_vb2_buf_queue()
  mutex_lock(&inst->lock); --> line 1346 (Lock B)
  session_process_buf()
    venus_pm_load_scale()
      load_scale_v4() via a function pointer
"core->pm_ops->load_scale(...)"
        mutex_lock(&core->lock); --> line 966 (Lock A)

Besides, if "core->pm_ops->load_scale(...)" is load_scale_v1():
load_scale_v1()
  load_per_type()
    mutex_lock(&core->lock); --> line 150 (Lock A)

When venus_event_notify() and venus_helper_vb2_buf_queue() are
concurrently executed, the deadlock can occur.

I am not quite sure whether this possible deadlock is real and how to
fix it if it is real.
Any feedback would be appreciated, thanks

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>


Best wishes,
Jia-Ju Bai

\
 
 \ /
  Last update: 2021-08-23 13:51    [W:0.030 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site