[kernel] r19600 - in dists/sid/linux/debian: . patches patches/bugfix/all
Ben Hutchings
benh at alioth.debian.org
Mon Dec 10 00:14:48 UTC 2012
Author: benh
Date: Mon Dec 10 00:14:48 2012
New Revision: 19600
Log:
megaraid_sas: fix memory leak if SGL has zero length entries (Closes: #688198)
Added:
dists/sid/linux/debian/patches/bugfix/all/megaraid_sas-fix-memory-leak-if-SGL-has-zero-length-entries.patch
Modified:
dists/sid/linux/debian/changelog
dists/sid/linux/debian/patches/series
Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog Mon Dec 10 00:09:47 2012 (r19599)
+++ dists/sid/linux/debian/changelog Mon Dec 10 00:14:48 2012 (r19600)
@@ -124,6 +124,8 @@
- hrtimer: Raise softirq if hrtimer irq stalled
- rcu: Disable RCU_FAST_NO_HZ on RT
- net: netfilter: Serialize xt_write_recseq sections on RT
+ * megaraid_sas: fix memory leak if SGL has zero length entries
+ (Closes: #688198)
[ Ian Campbell ]
* [xen] add support for microcode updating. (Closes: #693053)
Added: dists/sid/linux/debian/patches/bugfix/all/megaraid_sas-fix-memory-leak-if-SGL-has-zero-length-entries.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/sid/linux/debian/patches/bugfix/all/megaraid_sas-fix-memory-leak-if-SGL-has-zero-length-entries.patch Mon Dec 10 00:14:48 2012 (r19600)
@@ -0,0 +1,39 @@
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn at mork.no>
+Date: Wed, 21 Nov 2012 09:54:48 +0100
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Subject: [PATCH] megaraid_sas: fix memory leak if SGL has zero length entries
+Content-Transfer-Encoding: 8bit
+
+commit 98cb7e44 ([SCSI] megaraid_sas: Sanity check user
+supplied length before passing it to dma_alloc_coherent())
+introduced a memory leak. Memory allocated for entries
+following zero length SGL entries will not be freed.
+
+Reference: http://bugs.debian.org/688198
+Cc: <stable at vger.kernel.org>
+Signed-off-by: Bjørn Mork <bjorn at mork.no>
+Acked-by: Adam Radford <aradford at gmail.com>
+---
+ drivers/scsi/megaraid/megaraid_sas_base.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/drivers/scsi/megaraid/megaraid_sas_base.c
++++ b/drivers/scsi/megaraid/megaraid_sas_base.c
+@@ -4886,10 +4886,12 @@ megasas_mgmt_fw_ioctl(struct megasas_ins
+ sense, sense_handle);
+ }
+
+- for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) {
+- dma_free_coherent(&instance->pdev->dev,
+- kern_sge32[i].length,
+- kbuff_arr[i], kern_sge32[i].phys_addr);
++ for (i = 0; i < ioc->sge_count; i++) {
++ if (kbuff_arr[i])
++ dma_free_coherent(&instance->pdev->dev,
++ kern_sge32[i].length,
++ kbuff_arr[i],
++ kern_sge32[i].phys_addr);
+ }
+
+ megasas_return_cmd(instance, cmd);
Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series Mon Dec 10 00:09:47 2012 (r19599)
+++ dists/sid/linux/debian/patches/series Mon Dec 10 00:14:48 2012 (r19600)
@@ -430,3 +430,4 @@
bugfix/all/kmod-make-__request_module-killable.patch
bugfix/all/exec-do-not-leave-bprm-interp-on-stack.patch
bugfix/all/exec-use-ELOOP-for-max-recursion-depth.patch
+bugfix/all/megaraid_sas-fix-memory-leak-if-SGL-has-zero-length-entries.patch
More information about the Kernel-svn-changes
mailing list