Unverified Commit bf2d30f1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14167 CVE-2024-46733

Merge Pull Request from: @ci-robot 
 
PR sync from: Yifan Qiao <qiaoyifan4@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/5CRJH26GLIFDCZCYKORZBSJQYYMZUPXK/ 
Boris Burkov (1):
  btrfs: fix qgroup reserve leaks in cow_file_range

Haisu Wang (1):
  btrfs: fix the length of reserved qgroup to free


-- 
2.39.2
 
https://gitee.com/src-openeuler/kernel/issues/IARV5C 
 
Link:https://gitee.com/openeuler/kernel/pulls/14167

 

Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarYuan Can <yuancan@huawei.com>
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
parents e04cbbbd bfc67790
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1141,6 +1141,7 @@ static noinline int cow_file_range(struct inode *inode,
					     locked_page,
					     clear_bits,
					     page_ops);
		btrfs_qgroup_free_data(inode, NULL, start, cur_alloc_size);
		start += cur_alloc_size;
		if (start >= end)
			goto out;
@@ -1149,6 +1150,7 @@ static noinline int cow_file_range(struct inode *inode,
				     locked_page,
				     clear_bits | EXTENT_CLEAR_DATA_RESV,
				     page_ops);
	btrfs_qgroup_free_data(inode, NULL, start, end - start + 1);
	goto out;
}

@@ -1577,7 +1579,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
	}

error:
	if (ret && cur_offset < end)
	if (ret && cur_offset < end) {
		extent_clear_unlock_delalloc(inode, cur_offset, end, end,
					     locked_page, EXTENT_LOCKED |
					     EXTENT_DELALLOC | EXTENT_DEFRAG |
@@ -1585,6 +1587,8 @@ static noinline int run_delalloc_nocow(struct inode *inode,
					     PAGE_CLEAR_DIRTY |
					     PAGE_SET_WRITEBACK |
					     PAGE_END_WRITEBACK);
		btrfs_qgroup_free_data(inode, NULL, cur_offset, end - cur_offset + 1);
	}
	btrfs_free_path(path);
	return ret;
}