lkml.org 
[lkml]   [2012]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@gentoo.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.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);



\
 
 \ /
  Last update: 2012-02-05 23:31    [W:0.271 / U:0.760 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site