Commit a967efb
Btrfs: fix potential use-after-free for cloned bio
KASAN reports that there is a use-after-free case of bio in btrfs_map_bio.
If we need to submit IOs to several disks at a time, the original bio
would get cloned and mapped to the destination disk, but we really should
use the original bio instead of a cloned bio to do the sanity check
because cloned bios are likely to be freed by its endio.
Reported-by: Diego <[email protected]>
Signed-off-by: Liu Bo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 97bf5a5 commit a967efb
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6213 | 6213 | | |
6214 | 6214 | | |
6215 | 6215 | | |
6216 | | - | |
| 6216 | + | |
6217 | 6217 | | |
6218 | 6218 | | |
6219 | 6219 | | |
| |||
0 commit comments