[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120205220952.614104123@pcw.home.local>
Date: Sun, 05 Feb 2012 23:11:03 +0100
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Stratos Psomadakis <psomas@...too.org>,
James Bottomley <JBottomley@...allels.com>,
Greg KH <gregkh@...uxfoundation.org>
Subject: [PATCH 74/91] sym53c8xx: Fix NULL pointer dereference in slave_destroy
2.6.27-longterm review patch. If anyone has any objections, please let us know.
------------------
commit cced5041ed5a2d1352186510944b0ddfbdbe4c0b upstream.
sym53c8xx_slave_destroy unconditionally assumes that sym53c8xx_slave_alloc has
succesesfully allocated a sym_lcb. This can lead to a NULL pointer dereference
(exposed by commit 4e6c82b).
Signed-off-by: Stratos Psomadakis <psomas@...too.org>
Signed-off-by: James Bottomley <JBottomley@...allels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
Index: longterm-2.6.27/drivers/scsi/sym53c8xx_2/sym_glue.c
===================================================================
--- longterm-2.6.27.orig/drivers/scsi/sym53c8xx_2/sym_glue.c 2012-02-05 22:34:32.760914610 +0100
+++ longterm-2.6.27/drivers/scsi/sym53c8xx_2/sym_glue.c 2012-02-05 22:34:45.383915058 +0100
@@ -821,6 +821,10 @@
struct sym_hcb *np = sym_get_hcb(sdev->host);
struct sym_lcb *lp = sym_lp(&np->target[sdev->id], sdev->lun);
+ /* if slave_alloc returned before allocating a sym_lcb, return */
+ if (!lp)
+ return;
+
if (lp->itlq_tbl)
sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK * 4, "ITLQ_TBL");
kfree(lp->cb_tags);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists