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]
Message-ID: <e3de0d83-1170-05c8-672c-4428e781b988@gmail.com>
Date:   Mon, 27 Dec 2021 10:03:35 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     viro@...iv.linux.org.uk, Jens Axboe <axboe@...nel.dk>,
        hch@...radead.org
Cc:     linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] fs: super: possible ABBA deadlocks in do_thaw_all_callback()
 and freeze_bdev()

Hello,

My static analysis tool reports several possible ABBA deadlocks in Linux 
5.10:

do_thaw_all_callback()
   down_write(&sb->s_umount); --> Line 1028 (Lock A)
   emergency_thaw_bdev()
     thaw_bdev()
       mutex_lock(&bdev->bd_fsfreeze_mutex); --> Line 602 (Lock B)

freeze_bdev()
   mutex_lock(&bdev->bd_fsfreeze_mutex); --> Line 556 (Lock B)
   freeze_super()
     down_write(&sb->s_umount); --> Line 1716 (Lock A)
     down_write(&sb->s_umount); --> Line 1738 (Lock A)
   deactivate_super()
     down_write(&s->s_umount); --> Line 365 (Lock A)

When do_thaw_all_callback() and freeze_bdev() are concurrently executed, 
the deadlocks can occur.

I am not quite sure whether these possible deadlocks are real and how to 
fix them if them are 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