Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375087

[PATCH 3.14 11/76] aacraid: Fix memory leak in aac_fib_map_free

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.14 11/76] aacraid: Fix memory leak in aac_fib_map_free
Date 2016-04-10 21:50 +0200
Message-ID <rmtwT-1B9-39@gated-at.bofh.it> (permalink)
References <rmt3R-1mn-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>

commit f88fa79a61726ce9434df9b4aede36961f709f17 upstream.

aac_fib_map_free() calls pci_free_consistent() without checking that
dev->hw_fib_va is not NULL and dev->max_fib_size is not zero.If they are
indeed NULL/0, this will result in a hang as pci_free_consistent() will
attempt to invalidate cache for the entire 64-bit address space
(which would take a very long time).

Fixed by adding a check to make sure that dev->hw_fib_va and
dev->max_fib_size are not NULL and 0 respectively.

Fixes: 9ad5204d6 - "[SCSI]aacraid: incorrect dma mapping mask during blinked recover or user initiated reset"
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/aacraid/commsup.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -83,9 +83,12 @@ static int fib_map_alloc(struct aac_dev
 
 void aac_fib_map_free(struct aac_dev *dev)
 {
-	pci_free_consistent(dev->pdev,
-	  dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB),
-	  dev->hw_fib_va, dev->hw_fib_pa);
+	if (dev->hw_fib_va && dev->max_fib_size) {
+		pci_free_consistent(dev->pdev,
+		(dev->max_fib_size *
+		(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB)),
+		dev->hw_fib_va, dev->hw_fib_pa);
+	}
 	dev->hw_fib_va = NULL;
 	dev->hw_fib_pa = 0;
 }

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.14 00/76] 3.14.66-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 07/76] PCI: Disable IO/MEM decoding for devices with non-compliant BARs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 41/76] [media] saa7134: Fix bytesperline not being set correctly for planar formats Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 40/76] 8250: use callbacks to access UART_DLL/UART_DLM Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 26/76] Input: powermate - fix oops with malicious USB descriptors Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 45/76] ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 25/76] [media] pwc: Add USB id for Philips Spc880nc webcam Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:40 +0200
  [PATCH 3.14 11/76] aacraid: Fix memory leak in aac_fib_map_free Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:50 +0200
  [PATCH 3.14 10/76] sg: fix dxferp in from_to case Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:50 +0200
  [PATCH 3.14 13/76] usb: retry reset if a device times out Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 21:50 +0200
  Re: [PATCH 3.14 00/76] 3.14.66-stable review Guenter Roeck <linux@roeck-us.net> - 2016-04-10 22:10 +0200
    Re: [PATCH 3.14 00/76] 3.14.66-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 22:40 +0200
  [PATCH 3.14 68/76] target: Fix target_release_cmd_kref shutdown comp leak Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 22:40 +0200
  [PATCH 3.14 64/76] tracing: Fix trace_printk() to print when not using bprintk() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 22:40 +0200
  Re: [PATCH 3.14 00/76] 3.14.66-stable review Guenter Roeck <linux@roeck-us.net> - 2016-04-11 05:20 +0200
    Re: [PATCH 3.14 00/76] 3.14.66-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-12 16:20 +0200
  Re: [PATCH 3.14 00/76] 3.14.66-stable review shuahkh <shuahkh@osg.sisa.samsung.com> - 2016-04-11 19:30 +0200

csiph-web