mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 04:47:05 +00:00
btrfs: send: handle path ref underflow in header iterate_inode_ref()
[ Upstream commit 3c6ee34c6f
]
Change BUG_ON to proper error handling if building the path buffer
fails. The pointers are not printed so we don't accidentally leak kernel
addresses.
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0f30f95b91
commit
9ae356c627
1 changed files with 9 additions and 1 deletions
|
@ -1015,7 +1015,15 @@ static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path,
|
|||
ret = PTR_ERR(start);
|
||||
goto out;
|
||||
}
|
||||
BUG_ON(start < p->buf);
|
||||
if (unlikely(start < p->buf)) {
|
||||
btrfs_err(root->fs_info,
|
||||
"send: path ref buffer underflow for key (%llu %u %llu)",
|
||||
found_key->objectid,
|
||||
found_key->type,
|
||||
found_key->offset);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
p->start = start;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue