]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.18.137/scsi-csiostor-fix-null-pointer-dereference-in-csio_v.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.137 / scsi-csiostor-fix-null-pointer-dereference-in-csio_v.patch
1 From 81a3fcca7517b5e0309ebb5b9112741575d7f791 Mon Sep 17 00:00:00 2001
2 From: Varun Prakash <varun@chelsio.com>
3 Date: Sat, 12 Jan 2019 22:14:30 +0530
4 Subject: scsi: csiostor: fix NULL pointer dereference in
5 csio_vport_set_state()
6
7 [ Upstream commit fe35a40e675473eb65f2f5462b82770f324b5689 ]
8
9 Assign fc_vport to ln->fc_vport before calling csio_fcoe_alloc_vnp() to
10 avoid a NULL pointer dereference in csio_vport_set_state().
11
12 ln->fc_vport is dereferenced in csio_vport_set_state().
13
14 Signed-off-by: Varun Prakash <varun@chelsio.com>
15 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
17 ---
18 drivers/scsi/csiostor/csio_attr.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 diff --git a/drivers/scsi/csiostor/csio_attr.c b/drivers/scsi/csiostor/csio_attr.c
22 index 065a87ace623b..22b800b5ac7ff 100644
23 --- a/drivers/scsi/csiostor/csio_attr.c
24 +++ b/drivers/scsi/csiostor/csio_attr.c
25 @@ -582,12 +582,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable)
26 }
27
28 fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING);
29 + ln->fc_vport = fc_vport;
30
31 if (csio_fcoe_alloc_vnp(hw, ln))
32 goto error;
33
34 *(struct csio_lnode **)fc_vport->dd_data = ln;
35 - ln->fc_vport = fc_vport;
36 if (!fc_vport->node_name)
37 fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln));
38 if (!fc_vport->port_name)
39 --
40 2.19.1
41