diff options
author | Nikos Tsironis <ntsironis@arrikto.com> | 2020-03-27 17:01:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-17 17:13:39 +0300 |
commit | 6709d665259a678200af6fb7ce9b95a3e3aae74f (patch) | |
tree | e0faa0969aae8bd8c7a58264bfceca804c7663f5 /lib | |
parent | c159c51aa421f88d488a744d7b871e2e0c42ab45 (diff) | |
download | linux-6709d665259a678200af6fb7ce9b95a3e3aae74f.tar.xz |
dm clone: Add missing casts to prevent overflows and data corruption
commit 9fc06ff56845cc5ccafec52f545fc2e08d22f849 upstream.
Add missing casts when converting from regions to sectors.
In case BITS_PER_LONG == 32, the lack of the appropriate casts can lead
to overflows and miscalculation of the device sector.
As a result, we could end up discarding and/or copying the wrong parts
of the device, thus corrupting the device's data.
Fixes: 7431b7835f55 ("dm: add clone target")
Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions