]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ext4: release bs.bh before re-using in ext4_xattr_block_find()
authorVasily Averin <vvs@virtuozzo.com>
Wed, 7 Nov 2018 16:07:01 +0000 (11:07 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Nov 2018 06:32:48 +0000 (07:32 +0100)
commit 45ae932d246f721e6584430017176cbcadfde610 upstream.

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 <vvs@virtuozzo.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 2.6.26
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c

index 9b4f642d6dea70493a201e524d3807ced2f0cd70..9cf0fb3fb3542b8f6024d86ab7d51d962317a2ab 100644 (file)
@@ -1162,6 +1162,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;