From 0174e6cc91798da46d6a8970ce2b3be7ad41d64d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 20 Feb 2020 08:32:39 +0100 Subject: [PATCH] 4.14-stable patches added patches: scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch --- ...r-the-bh_mapped-flag-when-forgetting.patch | 9 +---- ...a-potential-null-pointer-dereference.patch | 37 +++++++++++++++++++ queue-4.14/series | 1 + 3 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 queue-4.14/scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch diff --git a/queue-4.14/jbd2-do-not-clear-the-bh_mapped-flag-when-forgetting.patch b/queue-4.14/jbd2-do-not-clear-the-bh_mapped-flag-when-forgetting.patch index a6a85b5b15c..6bc7ec2977e 100644 --- a/queue-4.14/jbd2-do-not-clear-the-bh_mapped-flag-when-forgetting.patch +++ b/queue-4.14/jbd2-do-not-clear-the-bh_mapped-flag-when-forgetting.patch @@ -49,14 +49,12 @@ Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Sasha Levin --- - fs/jbd2/commit.c | 25 +++++++++++++++++++++---- + fs/jbd2/commit.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) -diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c -index 89cbf45a1dcda..cb0da3d4adc04 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c -@@ -982,12 +982,29 @@ void jbd2_journal_commit_transaction(journal_t *journal) +@@ -982,12 +982,29 @@ restart_loop: * pagesize and it is attached to the last partial page. */ if (buffer_freed(bh) && !jh->b_next_transaction) { @@ -90,6 +88,3 @@ index 89cbf45a1dcda..cb0da3d4adc04 100644 } if (buffer_jbddirty(bh)) { --- -2.20.1 - diff --git a/queue-4.14/scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch b/queue-4.14/scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch new file mode 100644 index 00000000000..b76fb11de60 --- /dev/null +++ b/queue-4.14/scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch @@ -0,0 +1,37 @@ +From 35a79a63517981a8aea395497c548776347deda8 Mon Sep 17 00:00:00 2001 +From: Allen Pais +Date: Wed, 18 Sep 2019 22:06:58 +0530 +Subject: scsi: qla2xxx: fix a potential NULL pointer dereference + +From: Allen Pais + +commit 35a79a63517981a8aea395497c548776347deda8 upstream. + +alloc_workqueue is not checked for errors and as a result a potential +NULL dereference could occur. + +Link: https://lore.kernel.org/r/1568824618-4366-1-git-send-email-allen.pais@oracle.com +Signed-off-by: Allen Pais +Reviewed-by: Martin Wilck +Acked-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +[Ajay: Modified to apply on v4.14.y] +Signed-off-by: Ajay Kaher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/qla2xxx/qla_os.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/scsi/qla2xxx/qla_os.c ++++ b/drivers/scsi/qla2xxx/qla_os.c +@@ -3178,6 +3178,10 @@ qla2x00_probe_one(struct pci_dev *pdev, + base_vha->mgmt_svr_loop_id, host->sg_tablesize); + + ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); ++ if (unlikely(!ha->wq)) { ++ ret = -ENOMEM; ++ goto probe_failed; ++ } + + if (ha->mqenable) { + bool mq = false; diff --git a/queue-4.14/series b/queue-4.14/series index 38cb7b020c1..6e3dd55b915 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -26,3 +26,4 @@ perf-x86-intel-fix-inaccurate-period-in-context-switch-for-auto-reload.patch hwmon-pmbus-ltc2978-fix-pmbus-polling-of-mfr_common-definitions.patch jbd2-move-the-clearing-of-b_modified-flag-to-the-jou.patch jbd2-do-not-clear-the-bh_mapped-flag-when-forgetting.patch +scsi-qla2xxx-fix-a-potential-null-pointer-dereference.patch -- 2.47.3