diff options
| author | Roi Martin <[email protected]> | 2024-10-09 08:08:33 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2024-10-11 17:54:52 +0000 |
| commit | 66691c6e2f18d2aa4b22ffb624b9bdc97e9979e4 (patch) | |
| tree | 9d03720ba384fa0ef0ca7268a777bd2a24c2b912 /rust/helpers/helpers.c | |
| parent | btrfs: use sector numbers as keys for the dirty extents xarray (diff) | |
| download | kernel-66691c6e2f18d2aa4b22ffb624b9bdc97e9979e4.tar.gz kernel-66691c6e2f18d2aa4b22ffb624b9bdc97e9979e4.zip | |
btrfs: fix uninitialized pointer free in add_inode_ref()
The add_inode_ref() function does not initialize the "name" struct when
it is declared. If any of the following calls to "read_one_inode()
returns NULL,
dir = read_one_inode(root, parent_objectid);
if (!dir) {
ret = -ENOENT;
goto out;
}
inode = read_one_inode(root, inode_objectid);
if (!inode) {
ret = -EIO;
goto out;
}
then "name.name" would be freed on "out" before being initialized.
out:
...
kfree(name.name);
This issue was reported by Coverity with CID 1526744.
Fixes: e43eec81c516 ("btrfs: use struct qstr instead of name and namelen pairs")
CC: [email protected] # 6.6+
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Roi Martin <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions
