summaryrefslogtreecommitdiff
path: root/lib/test_xarray.c
diff options
context:
space:
mode:
authorNikos Tsironis <ntsironis@arrikto.com>2020-03-27 16:01:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-17 10:50:17 +0200
commit996f8f1ba72a8b8b05e591fb96cbeb31a449476d (patch)
treecbe23853a7ab74bd83a9c3fb1ec75d85a13abc31 /lib/test_xarray.c
parent2e703059348d8aa2cbcdbbaed284557e76edf460 (diff)
dm clone: Add overflow check for number of regions
commit cd481c12269b4d276f1a52eda0ebd419079bfe3a upstream. Add overflow check for clone->nr_regions variable, which holds the number of regions of the target. The overflow can occur with sufficiently large devices, if BITS_PER_LONG == 32. E.g., if the region size is 8 sectors (4K), the overflow would occur for device sizes > 34359738360 sectors (~16TB). This could result in multiple device sectors wrongly mapping to the same region number, due to the truncation from 64 bits to 32 bits, which would lead to data corruption. 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/test_xarray.c')
0 files changed, 0 insertions, 0 deletions