aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorTejun Heo <[email protected]>2010-07-20 22:18:07 +0000
committerAl Viro <[email protected]>2010-08-09 20:48:59 +0000
commit4f331f01b9c43bf001d3ffee578a97a1e0633eac (patch)
tree77cd690ab7af2624e3fd7932563f6dc0f5d6441a /security/selinux/hooks.c
parentsysv: do not mark superblock dirty on remount (diff)
downloadkernel-4f331f01b9c43bf001d3ffee578a97a1e0633eac.tar.gz
kernel-4f331f01b9c43bf001d3ffee578a97a1e0633eac.zip
vfs: don't hold s_umount over close_bdev_exclusive() call
Fix an obscure AB-BA deadlock in get_sb_bdev(). When a superblock is mounted more than once get_sb_bdev() calls close_bdev_exclusive() to drop the extra bdev reference while holding s_umount. However, sb->s_umount nests inside bd_mutex during __invalidate_device() and close_bdev_exclusive() acquires bd_mutex during blkdev_put(); thus creating an AB-BA deadlock. This condition doesn't trigger frequently. For this condition to be visible to lockdep, the filesystem must occupy the whole device (as __invalidate_device() only grabs bd_mutex for the whole device), the FS must be mounted more than once and partition rescan should be issued while the FS is still mounted. Fix it by dropping s_umount over close_bdev_exclusive(). Signed-off-by: Tejun Heo <[email protected]> Reported-by: Ciprian Docan <[email protected]> Cc: Al Viro <[email protected]> Acked-by: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Al Viro <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions