[kernel] r15525 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series
Ben Hutchings
benh at alioth.debian.org
Mon Apr 19 23:34:50 UTC 2010
Author: benh
Date: Mon Apr 19 23:34:48 2010
New Revision: 15525
Log:
megaraid_sas: Fix copying of sense data for 32-bit management tools on 64-bit kernel (Closes: #578398)
Added:
dists/sid/linux-2.6/debian/patches/bugfix/all/megaraid_sas-fix-compat_ioctl-sense_ptr.patch
Modified:
dists/sid/linux-2.6/debian/changelog
dists/sid/linux-2.6/debian/patches/series/12
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog Mon Apr 19 23:09:43 2010 (r15524)
+++ dists/sid/linux-2.6/debian/changelog Mon Apr 19 23:34:48 2010 (r15525)
@@ -22,6 +22,8 @@
* forcedeth: Fix hardware version check for TX bug workaround
(Closes: #572201)
* rndis_host: Poll status channel before control channel (Closes: #576929)
+ * megaraid_sas: Fix copying of sense data for 32-bit management tools on
+ 64-bit kernel (Closes: #578398)
[ maximilian attems]
* Ignore ABI breakage due to libata switch.
Added: dists/sid/linux-2.6/debian/patches/bugfix/all/megaraid_sas-fix-compat_ioctl-sense_ptr.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/megaraid_sas-fix-compat_ioctl-sense_ptr.patch Mon Apr 19 23:34:48 2010 (r15525)
@@ -0,0 +1,68 @@
+From b3dc1a212e5167984616445990c76056034f8eeb Mon Sep 17 00:00:00 2001
+From: Tomas Henzl <thenzl at redhat.com>
+Date: Thu, 11 Feb 2010 18:01:50 +0100
+Subject: [PATCH] [SCSI] megaraid_sas: fix for 32bit apps
+
+It looks like this patch -
+
+commit 7b2519afa1abd1b9f63aa1e90879307842422dae
+Author: Yang, Bo <Bo.Yang at lsi.com>
+Date: Tue Oct 6 14:52:20 2009 -0600
+
+ [SCSI] megaraid_sas: fix 64 bit sense pointer truncation
+
+has caused a problem for 32bit programs with 64bit os -
+
+http://bugzilla.kernel.org/show_bug.cgi?id=15001
+
+fix by converting the user space 32bit pointer to a 64 bit one when
+needed.
+
+[jejb: fix up some 64 bit warnings]
+Signed-off-by: Tomas Henzl <thenzl at redhat.com>
+Cc: Bo Yang <Bo.Yang at lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley at suse.de>
+---
+ drivers/scsi/megaraid/megaraid_sas.c | 18 ++++++++++++++++--
+ 1 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
+index 708ea31..d9b8ca5 100644
+--- a/drivers/scsi/megaraid/megaraid_sas.c
++++ b/drivers/scsi/megaraid/megaraid_sas.c
+@@ -3781,6 +3781,7 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
+ compat_alloc_user_space(sizeof(struct megasas_iocpacket));
+ int i;
+ int error = 0;
++ compat_uptr_t ptr;
+
+ if (clear_user(ioc, sizeof(*ioc)))
+ return -EFAULT;
+@@ -3793,9 +3794,22 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
+ copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32)))
+ return -EFAULT;
+
+- for (i = 0; i < MAX_IOCTL_SGE; i++) {
+- compat_uptr_t ptr;
++ /*
++ * The sense_ptr is used in megasas_mgmt_fw_ioctl only when
++ * sense_len is not null, so prepare the 64bit value under
++ * the same condition.
++ */
++ if (ioc->sense_len) {
++ void __user **sense_ioc_ptr =
++ (void __user **)(ioc->frame.raw + ioc->sense_off);
++ compat_uptr_t *sense_cioc_ptr =
++ (compat_uptr_t *)(cioc->frame.raw + cioc->sense_off);
++ if (get_user(ptr, sense_cioc_ptr) ||
++ put_user(compat_ptr(ptr), sense_ioc_ptr))
++ return -EFAULT;
++ }
+
++ for (i = 0; i < MAX_IOCTL_SGE; i++) {
+ if (get_user(ptr, &cioc->sgl[i].iov_base) ||
+ put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) ||
+ copy_in_user(&ioc->sgl[i].iov_len,
+--
+1.7.0.3
+
Modified: dists/sid/linux-2.6/debian/patches/series/12
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/12 Mon Apr 19 23:09:43 2010 (r15524)
+++ dists/sid/linux-2.6/debian/patches/series/12 Mon Apr 19 23:34:48 2010 (r15525)
@@ -12,3 +12,4 @@
+ bugfix/all/block-blk_abort_request-lock-fix.patch
+ bugfix/mips/enable-pata-platform.patch
+ bugfix/all/rndis_host-Poll-status-channel-before-control-channel.patch
++ bugfix/all/megaraid_sas-fix-compat_ioctl-sense_ptr.patch
More information about the Kernel-svn-changes
mailing list