From: Greg Kroah-Hartman Date: Thu, 21 Mar 2019 08:18:41 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v3.18.137~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0332824adf900c9c8fcc97219bcb4208dd0d45f1;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: dm-fix-to_sector-for-32bit.patch --- diff --git a/queue-4.4/dm-fix-to_sector-for-32bit.patch b/queue-4.4/dm-fix-to_sector-for-32bit.patch new file mode 100644 index 00000000000..67b8c0dbbe9 --- /dev/null +++ b/queue-4.4/dm-fix-to_sector-for-32bit.patch @@ -0,0 +1,43 @@ +From 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Sun, 6 Jan 2019 21:06:25 +1100 +Subject: dm: fix to_sector() for 32bit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: NeilBrown + +commit 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 upstream. + +A dm-raid array with devices larger than 4GB won't assemble on +a 32 bit host since _check_data_dev_sectors() was added in 4.16. +This is because to_sector() treats its argument as an "unsigned long" +which is 32bits (4GB) on a 32bit host. Using "unsigned long long" +is more correct. + +Kernels as early as 4.2 can have other problems due to to_sector() +being used on the size of a device. + +Fixes: 0cf4503174c1 ("dm raid: add support for the MD RAID0 personality") +cc: stable@vger.kernel.org (v4.2+) +Reported-and-tested-by: Guillaume Perréal +Signed-off-by: NeilBrown +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/device-mapper.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/device-mapper.h ++++ b/include/linux/device-mapper.h +@@ -593,7 +593,7 @@ extern struct ratelimit_state dm_ratelim + */ + #define dm_target_offset(ti, sector) ((sector) - (ti)->begin) + +-static inline sector_t to_sector(unsigned long n) ++static inline sector_t to_sector(unsigned long long n) + { + return (n >> SECTOR_SHIFT); + } diff --git a/queue-4.4/series b/queue-4.4/series index 3ad6d064186..66ab8615623 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -211,3 +211,4 @@ powerpc-wii-properly-disable-use-of-bats-when-requested.patch powerpc-powernv-make-opal-log-only-readable-by-root.patch powerpc-83xx-also-save-restore-sprg4-7-during-suspend.patch arm-s3c24xx-fix-boolean-expressions-in-osiris_dvs_notify.patch +dm-fix-to_sector-for-32bit.patch