Skip to content
Commit 338580a7 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Sasha Levin
Browse files

dm-integrity: fix a memory leak when rechecking the data



[ Upstream commit 55e565c4 ]

Memory for the "checksums" pointer will leak if the data is rechecked
after checksum failure (because the associated kfree won't happen due
to 'goto skip_io').

Fix this by freeing the checksums memory before recheck, and just use
the "checksum_onstack" memory for storing checksum during recheck.

Fixes: c88f5e55 ("dm-integrity: recheck the integrity tag after a failure")
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4a73b5ac
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment