btrfs: don't BUG_ON on ENOMEM from btrfs_lookup_extent_info() in walk_down_proc()

[ Upstream commit a580fb2c3479d993556e1c31b237c9e5be4944a3 ]

Fix CVE: CVE-2024-46841

We handle errors here properly, ENOMEM isn't fatal, return the error.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Haisu Wang <haisuwang@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
This commit is contained in:
Josef Bacik 2024-05-07 14:12:10 -04:00 committed by Jianping Liu
parent 3326d9af24
commit a56760dedf
1 changed files with 0 additions and 1 deletions

View File

@ -4739,7 +4739,6 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
eb->start, level, 1, eb->start, level, 1,
&wc->refs[level], &wc->refs[level],
&wc->flags[level]); &wc->flags[level]);
BUG_ON(ret == -ENOMEM);
if (ret) if (ret)
return ret; return ret;
BUG_ON(wc->refs[level] == 0); BUG_ON(wc->refs[level] == 0);