]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.0.18/sym53c8xx-fix-null-pointer-dereference-in-slave_destroy.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.0.18 / sym53c8xx-fix-null-pointer-dereference-in-slave_destroy.patch
1 From cced5041ed5a2d1352186510944b0ddfbdbe4c0b Mon Sep 17 00:00:00 2001
2 From: Stratos Psomadakis <psomas@gentoo.org>
3 Date: Sun, 4 Dec 2011 02:23:54 +0200
4 Subject: [SCSI] sym53c8xx: Fix NULL pointer dereference in slave_destroy
5
6 From: Stratos Psomadakis <psomas@gentoo.org>
7
8 commit cced5041ed5a2d1352186510944b0ddfbdbe4c0b upstream.
9
10 sym53c8xx_slave_destroy unconditionally assumes that sym53c8xx_slave_alloc has
11 succesesfully allocated a sym_lcb. This can lead to a NULL pointer dereference
12 (exposed by commit 4e6c82b).
13
14 Signed-off-by: Stratos Psomadakis <psomas@gentoo.org>
15 Signed-off-by: James Bottomley <JBottomley@Parallels.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18 ---
19 drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++++
20 1 file changed, 4 insertions(+)
21
22 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c
23 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
24 @@ -839,6 +839,10 @@ static void sym53c8xx_slave_destroy(stru
25 struct sym_lcb *lp = sym_lp(tp, sdev->lun);
26 unsigned long flags;
27
28 + /* if slave_alloc returned before allocating a sym_lcb, return */
29 + if (!lp)
30 + return;
31 +
32 spin_lock_irqsave(np->s.host->host_lock, flags);
33
34 if (lp->busy_itlq || lp->busy_itl) {