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:   Sat, 7 Oct 2017 18:11:01 +0800
From:   Jia-Ju Bai <baijiaju1990@....com>
To:     viro@...iv.linux.org.uk, dhowells@...hat.com
Cc:     linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [BUG] fs/afs/flock: possible sleep-in-atomic bugs in afs_do_setlk

According to fs/afs/flock.c, the kernel may sleep under a spinlock,
and the function call paths are:
afs_do_setlk (acquire the spinlock: inode->i_lock)
   afs_vnode_fetch_status
     schedule --> may sleep

afs_do_setlk (acquire the spinlock: inode->i_lock)
   wait_event_interruptible --> may sleep

These bugs may be introduced by only considering "vnode->lock" but 
ignoring "inode->i_lock".

A possible fix is to unlock "inode->i_lock" before calling 
afs_vnode_fetch_status and wait_event_interruptible, and lock 
"inode->i_lock" again after them.

These bugs are found by my static analysis tool and my code review.


Thanks,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ