From: Sasha Levin Date: Mon, 29 Mar 2021 04:00:44 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v5.11.11~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fa256cec9d2fe7af86487d38e4dc44977daa999;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/perf-auxtrace-fix-auxtrace-queue-conflict.patch b/queue-4.14/perf-auxtrace-fix-auxtrace-queue-conflict.patch new file mode 100644 index 00000000000..7978f6de0c5 --- /dev/null +++ b/queue-4.14/perf-auxtrace-fix-auxtrace-queue-conflict.patch @@ -0,0 +1,57 @@ +From abf151e9fed0d5da22018729b36e9af730b3a9ba Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Mar 2021 17:11:43 +0200 +Subject: perf auxtrace: Fix auxtrace queue conflict + +From: Adrian Hunter + +[ Upstream commit b410ed2a8572d41c68bd9208555610e4b07d0703 ] + +The only requirement of an auxtrace queue is that the buffers are in +time order. That is achieved by making separate queues for separate +perf buffer or AUX area buffer mmaps. + +That generally means a separate queue per cpu for per-cpu contexts, and +a separate queue per thread for per-task contexts. + +When buffers are added to a queue, perf checks that the buffer cpu and +thread id (tid) match the queue cpu and thread id. + +However, generally, that need not be true, and perf will queue buffers +correctly anyway, so the check is not needed. + +In addition, the check gets erroneously hit when using sample mode to +trace multiple threads. + +Consequently, fix that case by removing the check. + +Fixes: e502789302a6 ("perf auxtrace: Add helpers for queuing AUX area tracing data") +Reported-by: Andi Kleen +Signed-off-by: Adrian Hunter +Reviewed-by: Andi Kleen +Cc: Jiri Olsa +Link: http://lore.kernel.org/lkml/20210308151143.18338-1-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/util/auxtrace.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c +index 44c8bcefe224..0224fc3aacc1 100644 +--- a/tools/perf/util/auxtrace.c ++++ b/tools/perf/util/auxtrace.c +@@ -250,10 +250,6 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues, + queue->set = true; + queue->tid = buffer->tid; + queue->cpu = buffer->cpu; +- } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) { +- pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n", +- queue->cpu, queue->tid, buffer->cpu, buffer->tid); +- return -EINVAL; + } + + buffer->buffer_nr = queues->next_buffer_nr++; +-- +2.30.1 + diff --git a/queue-4.14/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch b/queue-4.14/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch new file mode 100644 index 00000000000..f2061dd96c0 --- /dev/null +++ b/queue-4.14/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch @@ -0,0 +1,50 @@ +From 9e4d6ba55879291d4856adfad0d637d819e8f88c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Mar 2021 19:52:41 -0800 +Subject: scsi: mpt3sas: Fix error return code of mpt3sas_base_attach() + +From: Jia-Ju Bai + +[ Upstream commit 3401ecf7fc1b9458a19d42c0e26a228f18ac7dda ] + +When kzalloc() returns NULL, no error return code of mpt3sas_base_attach() +is assigned. To fix this bug, r is assigned with -ENOMEM in this case. + +Link: https://lore.kernel.org/r/20210308035241.3288-1-baijiaju1990@gmail.com +Fixes: c696f7b83ede ("scsi: mpt3sas: Implement device_remove_in_progress check in IOCTL path") +Reported-by: TOTE Robot +Signed-off-by: Jia-Ju Bai +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c +index 20bf1fa7f273..9e400def0d04 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -5455,14 +5455,18 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) + ioc->pend_os_device_add_sz++; + ioc->pend_os_device_add = kzalloc(ioc->pend_os_device_add_sz, + GFP_KERNEL); +- if (!ioc->pend_os_device_add) ++ if (!ioc->pend_os_device_add) { ++ r = -ENOMEM; + goto out_free_resources; ++ } + + ioc->device_remove_in_progress_sz = ioc->pend_os_device_add_sz; + ioc->device_remove_in_progress = + kzalloc(ioc->device_remove_in_progress_sz, GFP_KERNEL); +- if (!ioc->device_remove_in_progress) ++ if (!ioc->device_remove_in_progress) { ++ r = -ENOMEM; + goto out_free_resources; ++ } + + ioc->fwfault_debug = mpt3sas_fwfault_debug; + +-- +2.30.1 + diff --git a/queue-4.14/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch b/queue-4.14/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch new file mode 100644 index 00000000000..6432d07ab4c --- /dev/null +++ b/queue-4.14/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch @@ -0,0 +1,39 @@ +From 3a586b14db1b0f446134aa8a380343de0b02960c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 7 Mar 2021 19:30:24 -0800 +Subject: scsi: qedi: Fix error return code of qedi_alloc_global_queues() + +From: Jia-Ju Bai + +[ Upstream commit f69953837ca5d98aa983a138dc0b90a411e9c763 ] + +When kzalloc() returns NULL to qedi->global_queues[i], no error return code +of qedi_alloc_global_queues() is assigned. To fix this bug, status is +assigned with -ENOMEM in this case. + +Link: https://lore.kernel.org/r/20210308033024.27147-1-baijiaju1990@gmail.com +Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.") +Reported-by: TOTE Robot +Acked-by: Manish Rangankar +Signed-off-by: Jia-Ju Bai +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qedi/qedi_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c +index a742b8856776..b0a404d4e676 100644 +--- a/drivers/scsi/qedi/qedi_main.c ++++ b/drivers/scsi/qedi/qedi_main.c +@@ -1354,6 +1354,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) + if (!qedi->global_queues[i]) { + QEDI_ERR(&qedi->dbg_ctx, + "Unable to allocation global queue %d.\n", i); ++ status = -ENOMEM; + goto mem_alloc_failure; + } + +-- +2.30.1 + diff --git a/queue-4.14/series b/queue-4.14/series index 352026e17ae..7fd1eef0ddc 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -47,3 +47,6 @@ net-mlx5e-fix-error-path-for-ethtool-set-priv-flag.patch rdma-cxgb4-fix-adapter-le-hash-errors-while-destroyi.patch acpi-scan-rearrange-memory-allocation-in-acpi_device.patch acpi-scan-use-unique-number-for-instance_no.patch +perf-auxtrace-fix-auxtrace-queue-conflict.patch +scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch +scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch