diff options
| author | Mikulas Patocka <[email protected]> | 2023-07-03 15:12:39 +0000 |
|---|---|---|
| committer | Mike Snitzer <[email protected]> | 2023-07-25 15:55:50 +0000 |
| commit | d4a3806bea61c8ef6e0103d0f39786e00586522e (patch) | |
| tree | 2e91b285586b756330b1ac52c8fa44095f7fbf6a /drivers/md/dm-raid.c | |
| parent | Linux 6.5-rc2 (diff) | |
| download | kernel-d4a3806bea61c8ef6e0103d0f39786e00586522e.tar.gz kernel-d4a3806bea61c8ef6e0103d0f39786e00586522e.zip | |
dm integrity: fix double free on memory allocation failure
If the statement "recalc_tags = kvmalloc(recalc_tags_size, GFP_NOIO);"
fails, we call "vfree(recalc_buffer)" and we jump to the label "oom".
If the condition "recalc_sectors >= 1U << ic->sb->log2_sectors_per_block"
is false, we jump to the label "free_ret" and call "vfree(recalc_buffer)"
again, on an already released memory block.
Fix the bug by setting "recalc_buffer = NULL" after freeing it.
Fixes: da8b4fc1f63a ("dm integrity: only allocate recalculate buffer when needed")
Signed-off-by: Mikulas Patocka <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Diffstat (limited to 'drivers/md/dm-raid.c')
0 files changed, 0 insertions, 0 deletions
