dm clone: Add missing casts to prevent overflows and data corruption
Nikos Tsironis authored
commit 9fc06ff5 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: 7431b783

 ("dm: add clone target")
Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: default avatarNikos Tsironis <ntsironis@arrikto.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
6709d665
Name Last commit Last update
Documentation time/namespace: Add max_time_namespaces ucount
LICENSES LICENSES: Rename other to deprecated
arch arm64: dts: allwinner: h5: Fix PMU compatible
block block, bfq: fix use-after-free in bfq_idle_slice_timer_body
certs certs: Add wrapper function to check blacklisted binary hash
crypto crypto: rng - Fix a refcounting bug in crypto_rng_reset()
drivers dm clone: Add missing casts to prevent overflows and data corruption
fs io_uring: honor original task RLIMIT_FSIZE
include signal: Extend exec_id to 64bits
init int128: fix __uint128_t compiler test in Kconfig
ipc Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"
kernel sched/core: Remove duplicate assignment in sched_tick_remote()
lib XArray: Fix xa_find_next for large multi-index entries
mm mm, memcg: do not high throttle allocators based on wraparound
net Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
samples Merge tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
scripts Merge tag 'devicetree-fixes-for-5.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
security KEYS: reaching the keys quotas correctly
sound ALSA: hda/realtek - Add quirk for MSI GL63
tools tools: gpio: Fix out-of-tree build regression
usr initramfs: restore default compression behavior
virt Merge tag 'kvmarm-fixes-5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: use 'dts' diff driver for dts files
.gitignore selftest/lkdtm: Use local .gitignore
.mailmap mailmap: Update email address
COPYING COPYING: state that all contributions really are covered by this file
CREDITS MAINTAINERS: Hand MIPS over to Thomas
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst
MAINTAINERS MAINTAINERS: fix bad file pattern
Makefile Linux 5.6.4
README Drop all 00-INDEX files from Documentation/
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.