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>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Nov 2021 15:55:16 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     hao.wu@...el.com, trix@...hat.com, mdf@...nel.org
Cc:     linux-fpga@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] fpga: dfl: possible ABBA deadlock in
 dfl_fpga_cdev_assign_port() and fme_pr()

Hello,

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

dfl_fpga_cdev_assign_port()
   mutex_lock(&cdev->lock); --> Line 1067 (Lock A)
   mutex_lock(&pdata->lock); --> Line 1624 (Lock B)

fme_pr()
   mutex_lock(&pdata->lock); --> Line 126 (Lock B)
   fpga_region_program_fpga()
     fpga_bridges_enable()
       fpga_bridge_enable()
         fme_bridge_enable_set() --> function pointer via 
"bridge->br_ops->enable_set()"
           dfl_fpga_cdev_find_port()
             mutex_lock(&cdev->lock); --> Line 499 (LockA)

When dfl_fpga_cdev_assign_port() and fme_pr() 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