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  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]
Date:   Sat, 21 Dec 2019 19:34:28 +0800
From:   Murphy Zhou <>
Cc:     Jan Kara <>
Subject: [PATCH] ext4: ensure revoke credits when set xattr

It is possible that we need to release and forget blocks
during set xattr block, especially with 128 inode size,
so we need enough revoke credits to do that. Or we'll
hit WARNING since commit:
	[83448bd] ext4: Reserve revoke credits for freed blocks

This can be triggered easily in a kinda corner case:

	echo "fstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | md5sum  | cut -c -10`"


fallocate -l 200m test.img
mkfs.ext4 -F -b 4096 -I 128 test.img
mkdir -p $md0
mount -o loop test.img $md0 || exit
pushd $md0

mkdir ${d0}
setfacl -d -m 'u::rwx' ${d0}
mkdir ${d0}/${d1} # hit warning
echo $?
mkdir ${d0}/${d2}
rm -rf ${d0}

umount -d $md0
rm -rf $md0 test.img

Which is derived from the pjd test suite[1].

Patch tested by xfstests auto group.


Signed-off-by: Murphy Zhou <>
 fs/ext4/xattr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 8966a54..5c32c54 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -2319,6 +2319,12 @@ static struct buffer_head *ext4_xattr_get_block(struct inode *inode)
 			error = -ENOSPC;
 			goto cleanup;
+		error = ext4_journal_ensure_credits(handle, credits,
+				ext4_trans_default_revoke_credits(inode->i_sb));
+		if (error < 0) {
+			EXT4_ERROR_INODE(inode, "ensure credits (error %d)", error);
+			goto cleanup;
+		}
 	error = ext4_reserve_inode_write(handle, inode, &is.iloc);

Powered by blists - more mailing lists