lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 23 Aug 2021 19:50:31 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     stanimir.varbanov@...aro.org, agross@...nel.org,
        bjorn.andersson@...aro.org,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     Linux Media Mailing List <linux-media@...r.kernel.org>,
        linux-arm-msm@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] media: platform: qcom: venus: possible ABBA deadlock in
 venus_event_notify() and venus_helper_vb2_buf_queue()

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@...nghua.edu.cn>


Best wishes,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ