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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd6dfb63-6d3d-c8f6-f401-8bdd5334afed@linux.alibaba.com>
Date:   Tue, 14 Dec 2021 15:08:39 +0800
From:   Joseph Qi <joseph.qi@...ux.alibaba.com>
To:     Jia-Ju Bai <baijiaju1990@...il.com>, mark@...heh.com,
        jlbec@...lplan.org
Cc:     ocfs2-devel@....oracle.com,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] fs: ocfs2: possible ABBA deadlock in
 ocfs2_dio_end_io_write() and ocfs2_move_extents()

Hi,

Thanks for the report. But I don't think this is a possible deadlock in
practice. Please see my comments below.

On 12/10/21 4:38 PM, Jia-Ju Bai wrote:
> Hello,
> 
> My static analysis tool reports a possible ABBA deadlock in the ocfs2 module in Linux 5.10:
> 
> ocfs2_dio_end_io_write()
>   down_write(&oi->ip_alloc_sem); --> Line 2322 (Lock A)
>   ocfs2_del_inode_from_orphan()
>     inode_lock(orphan_dir_inode);  --> Line 2701 (Lock B)

Just as the variable name indicates, it is orphan dir inode, which is a
system file (something hidden inside the filesystem) and not visible for
end user.

> 
> ocfs2_move_extents()
>   inode_lock(inode); --> Line 916 (Lock B)

This is called from a ioctl from user, it a normal file inode.

Thanks,
Joseph

>   down_write(&OCFS2_I(inode)->ip_alloc_sem); --> Line 936 (Lock A)
> 
> When ocfs2_dio_end_io_write() and ocfs2_move_extents() are concurrently executed, the deadlocks 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