xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT
mainline inclusion from mainline-v5.3-rc6 commit 1fb254aa category: bugfix bugzilla: 13690 CVE: CVE-2019-15538 ------------------------------------------------- Benjamin Moody reported to Debian that XFS partially wedges when a chgrp fails on account of being out of disk quota. I ran his reproducer script: (and then as user dummy) $ dd if=/dev/urandom bs=1M count=50 of=/mnt/dummy/foo $ chgrp plugdev /mnt/dummy/foo and saw: Reviewed-by:zhengbin <zhengbin13@huawei.com> ================================================ WARNING: lock held when returning to user space! 5.3.0-rc5 #rc5 Tainted: G W ------------------------------------------------ chgrp/47006 is leaving the kernel with locks still held! 1 lock held by chgrp/47006: #0: 000000006664ea2d (&xfs_nondir_ilock_class){++++}, at: xfs_ilock+0xd2/0x290 [xfs] ...which is clearly caused by xfs_setattr_nonsize failing to unlock the ILOCK after the xfs_qm_vop_chown_reserve call fails. Add the missing unlock. Reported-by:
<benjamin.moody@gmail.com> Fixes: 253f4911 ("xfs: better xfs_trans_alloc interface") Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by:
Dave Chinner <dchinner@redhat.com> Tested-by:
Salvatore Bonaccorso <carnil@debian.org> Reviewed-by:
zhengbin <zhengbin13@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Please register or sign in to comment