From: Sasha Levin Date: Mon, 29 Mar 2021 04:00:44 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v5.11.11~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e888b4b4a5151487ef9f4c698cb517ac0d5ff289;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/perf-auxtrace-fix-auxtrace-queue-conflict.patch b/queue-4.19/perf-auxtrace-fix-auxtrace-queue-conflict.patch new file mode 100644 index 00000000000..a3864963962 --- /dev/null +++ b/queue-4.19/perf-auxtrace-fix-auxtrace-queue-conflict.patch @@ -0,0 +1,57 @@ +From e63b2b9e1bfd8394aa4ec7975150daf67fcf1d61 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 40c93d8158b5..f7c4dcb9d582 100644 +--- a/tools/perf/util/auxtrace.c ++++ b/tools/perf/util/auxtrace.c +@@ -256,10 +256,6 @@ static int auxtrace_queues__queue_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.19/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch b/queue-4.19/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch new file mode 100644 index 00000000000..3cfa6f04ef4 --- /dev/null +++ b/queue-4.19/scsi-mpt3sas-fix-error-return-code-of-mpt3sas_base_a.patch @@ -0,0 +1,50 @@ +From 13954ababc9f6388270a0ee9900bdafb38255e2a 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 07959047d4dc..447ac667f4b2 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -6629,14 +6629,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.19/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch b/queue-4.19/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch new file mode 100644 index 00000000000..30b08c54d72 --- /dev/null +++ b/queue-4.19/scsi-qedi-fix-error-return-code-of-qedi_alloc_global.patch @@ -0,0 +1,39 @@ +From d61e79152f420fc4b661211eb436f13d5c418fa3 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 e201c163ea1c..fe26144d390a 100644 +--- a/drivers/scsi/qedi/qedi_main.c ++++ b/drivers/scsi/qedi/qedi_main.c +@@ -1559,6 +1559,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.19/series b/queue-4.19/series index c231edf2ab9..65bcecdc235 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -59,3 +59,6 @@ revert-netfilter-x_tables-update-remaining-dereferen.patch acpi-scan-rearrange-memory-allocation-in-acpi_device.patch acpi-scan-use-unique-number-for-instance_no.patch dm-verity-add-root-hash-pkcs-7-signature-verificatio.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