From 7519a0591e5144f46484e35ea2336f0b821f1983 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 7 Nov 2018 11:07:43 -0500 Subject: [PATCH] add patch release-bs_bh-before-reusing-in-ext4_xattr_block_find --- ...e-bs_bh-before-reusing-in-ext4_xattr_block_find | 32 ++++++++++++++++++++++ series | 1 + timestamps | 5 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 release-bs_bh-before-reusing-in-ext4_xattr_block_find diff --git a/release-bs_bh-before-reusing-in-ext4_xattr_block_find b/release-bs_bh-before-reusing-in-ext4_xattr_block_find new file mode 100644 index 00000000..5cc8f5df --- /dev/null +++ b/release-bs_bh-before-reusing-in-ext4_xattr_block_find @@ -0,0 +1,32 @@ +ext4: release bs.bh before re-using in ext4_xattr_block_find() + +From: Vasily Averin + +bs.bh was taken in previous ext4_xattr_block_find() call, +it should be released before re-using + +Fixes: 7e01c8e5420b ("ext3/4: fix uninitialized bs in ...") +Signed-off-by: Vasily Averin +Signed-off-by: Theodore Ts'o +Cc: stable@kernel.org # 2.6.26 +--- + fs/ext4/xattr.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c +index 07c3a115f7ae..07b9a335c8eb 100644 +--- a/fs/ext4/xattr.c ++++ b/fs/ext4/xattr.c +@@ -2395,6 +2395,8 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, + error = ext4_xattr_block_set(handle, inode, &i, &bs); + } else if (error == -ENOSPC) { + if (EXT4_I(inode)->i_file_acl && !bs.s.base) { ++ brelse(bs.bh); ++ bs.bh = NULL; + error = ext4_xattr_block_find(inode, &i, &bs); + if (error) + goto cleanup; +-- +2.17.1 + + diff --git a/series b/series index 2e763e71..aac9a608 100644 --- a/series +++ b/series @@ -13,6 +13,7 @@ remove-unneeded-brelse-call-in-ext4_xattr_inode_update_ref fix-possible-leak-of-sbi_s_group_desc_leak-in-error-path avoid-memory-leak-of-s_journal_flag_rwsem-on-error-path fix-buffer-leak-in-ext4_xattr_get_block-on-error-path +release-bs_bh-before-reusing-in-ext4_xattr_block_find #################################################### # unstable patches diff --git a/timestamps b/timestamps index 27f5430c..2c7570ef 100755 --- a/timestamps +++ b/timestamps @@ -29,6 +29,7 @@ touch -d @1541544302 remove-unneeded-brelse-call-in-ext4_xattr_inode_update_ref touch -d @1541604773 fix-possible-leak-of-sbi_s_group_desc_leak-in-error-path touch -d @1541606188 avoid-memory-leak-of-s_journal_flag_rwsem-on-error-path touch -d @1541606493 fix-buffer-leak-in-ext4_xattr_get_block-on-error-path -touch -d @1541606526 series touch -d @1541606532 status -touch -d @1541606565 timestamps +touch -d @1541606821 release-bs_bh-before-reusing-in-ext4_xattr_block_find +touch -d @1541606841 series +touch -d @1541606844 timestamps -- 2.11.4.GIT