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:   Thu, 9 Dec 2021 19:10:44 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     tytso@....edu, adilger.kernel@...ger.ca
Cc:     linux-ext4@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] fs: ext4: possible ABBA deadlock in ext4_inline_data_truncate()
 and ext4_punch_hole()

Hello,

My static analysis tool reports a possible ABBA deadlock in the ext4 
module in Linux 5.10:

ext4_inline_data_truncate()
   down_write(&EXT4_I(inode)->i_data_sem); --> Line 1895 (Lock A)
   ext4_xattr_ibody_get()
     ext4_xattr_inode_get()
       ext4_xattr_inode_iget()
         inode_lock(inode); --> Line 427 (Lock B)

ext4_punch_hole()
   inode_lock(inode); --> Line 4018 (Lock B)
   ext4_update_disksize_before_punch()
     ext4_update_i_disksize()
       down_write(&EXT4_I(inode)->i_data_sem); --> Line 3248 (Lock A)

When ext4_inline_data_truncate() and ext4_punch_hole() 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