Commit 2dcf838
btrfs: fix invalid inode pointer dereferences during log replay
In a few places where we call read_one_inode(), if we get a NULL pointer
we end up jumping into an error path, or fallthrough in case of
__add_inode_ref(), where we then do something like this:
iput(&inode->vfs_inode);
which results in an invalid inode pointer that triggers an invalid memory
access, resulting in a crash.
Fix this by making sure we don't do such dereferences.
Fixes: b4c50cb ("btrfs: return a btrfs_inode from read_one_inode()")
CC: stable@vger.kernel.org # 6.15+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent e5b5596 commit 2dcf838
1 file changed
+6
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
672 | | - | |
| 671 | + | |
673 | 672 | | |
674 | 673 | | |
675 | 674 | | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
| 675 | + | |
| 676 | + | |
680 | 677 | | |
681 | 678 | | |
682 | 679 | | |
| |||
961 | 958 | | |
962 | 959 | | |
963 | 960 | | |
964 | | - | |
| 961 | + | |
| 962 | + | |
965 | 963 | | |
966 | 964 | | |
967 | 965 | | |
| |||
1176 | 1174 | | |
1177 | 1175 | | |
1178 | 1176 | | |
| 1177 | + | |
1179 | 1178 | | |
1180 | | - | |
1181 | 1179 | | |
1182 | 1180 | | |
1183 | 1181 | | |
| |||
0 commit comments