From: Sasha Levin Date: Mon, 10 Apr 2023 12:34:54 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v5.15.107~38^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=979df3af1ff73c87068101ab603bffc1bfff7387;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/iio-adc-ad7791-fix-irq-flags.patch b/queue-5.10/iio-adc-ad7791-fix-irq-flags.patch new file mode 100644 index 00000000000..821a3483c7d --- /dev/null +++ b/queue-5.10/iio-adc-ad7791-fix-irq-flags.patch @@ -0,0 +1,40 @@ +From 0f1590590522465add53b7bd4fc5e85e1ca2022f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 20 Jan 2023 13:46:45 +0100 +Subject: iio: adc: ad7791: fix IRQ flags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nuno Sá + +[ Upstream commit 0c6ef985a1fd8a74dcb5cad941ddcadd55cb8697 ] + +The interrupt is triggered on the falling edge rather than being a level +low interrupt. + +Fixes: da4d3d6bb9f6 ("iio: adc: ad-sigma-delta: Allow custom IRQ flags") +Signed-off-by: Nuno Sá +Link: https://lore.kernel.org/r/20230120124645.819910-1-nuno.sa@analog.com +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + drivers/iio/adc/ad7791.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/iio/adc/ad7791.c b/drivers/iio/adc/ad7791.c +index d57ad966e17c1..f3502f12653b3 100644 +--- a/drivers/iio/adc/ad7791.c ++++ b/drivers/iio/adc/ad7791.c +@@ -253,7 +253,7 @@ static const struct ad_sigma_delta_info ad7791_sigma_delta_info = { + .has_registers = true, + .addr_shift = 4, + .read_mask = BIT(3), +- .irq_flags = IRQF_TRIGGER_LOW, ++ .irq_flags = IRQF_TRIGGER_FALLING, + }; + + static int ad7791_read_raw(struct iio_dev *indio_dev, +-- +2.39.2 + diff --git a/queue-5.10/perf-core-fix-the-same-task-check-in-perf_event_set_.patch b/queue-5.10/perf-core-fix-the-same-task-check-in-perf_event_set_.patch new file mode 100644 index 00000000000..537229afc32 --- /dev/null +++ b/queue-5.10/perf-core-fix-the-same-task-check-in-perf_event_set_.patch @@ -0,0 +1,73 @@ +From e7d2d5189a69dd4209a0151be372d027ceaa6087 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 22 Mar 2023 13:24:49 -0700 +Subject: perf/core: Fix the same task check in perf_event_set_output +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kan Liang + +[ Upstream commit 24d3ae2f37d8bc3c14b31d353c5d27baf582b6a6 ] + +The same task check in perf_event_set_output has some potential issues +for some usages. + +For the current perf code, there is a problem if using of +perf_event_open() to have multiple samples getting into the same mmap’d +memory when they are both attached to the same process. +https://lore.kernel.org/all/92645262-D319-4068-9C44-2409EF44888E@gmail.com/ +Because the event->ctx is not ready when the perf_event_set_output() is +invoked in the perf_event_open(). + +Besides the above issue, before the commit bd2756811766 ("perf: Rewrite +core context handling"), perf record can errors out when sampling with +a hardware event and a software event as below. + $ perf record -e cycles,dummy --per-thread ls + failed to mmap with 22 (Invalid argument) +That's because that prior to the commit a hardware event and a software +event are from different task context. + +The problem should be a long time issue since commit c3f00c70276d +("perk: Separate find_get_context() from event initialization"). + +The task struct is stored in the event->hw.target for each per-thread +event. It is a more reliable way to determine whether two events are +attached to the same task. + +The event->hw.target was also introduced several years ago by the +commit 50f16a8bf9d7 ("perf: Remove type specific target pointers"). It +can not only be used to fix the issue with the current code, but also +back port to fix the issues with an older kernel. + +Note: The event->hw.target was introduced later than commit +c3f00c70276d. The patch may cannot be applied between the commit +c3f00c70276d and commit 50f16a8bf9d7. Anybody that wants to back-port +this at that period may have to find other solutions. + +Fixes: c3f00c70276d ("perf: Separate find_get_context() from event initialization") +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Zhengjun Xing +Link: https://lkml.kernel.org/r/20230322202449.512091-1-kan.liang@linux.intel.com +Signed-off-by: Sasha Levin +--- + kernel/events/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/events/core.c b/kernel/events/core.c +index e2e1371fbb9d3..f0df3bc0e6415 100644 +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -11622,7 +11622,7 @@ perf_event_set_output(struct perf_event *event, struct perf_event *output_event) + /* + * If its not a per-cpu rb, it must be the same task. + */ +- if (output_event->cpu == -1 && output_event->ctx != event->ctx) ++ if (output_event->cpu == -1 && output_event->hw.target != event->hw.target) + goto out; + + /* +-- +2.39.2 + diff --git a/queue-5.10/scsi-iscsi_tcp-check-that-sock-is-valid-before-iscsi.patch b/queue-5.10/scsi-iscsi_tcp-check-that-sock-is-valid-before-iscsi.patch new file mode 100644 index 00000000000..49156ba04a3 --- /dev/null +++ b/queue-5.10/scsi-iscsi_tcp-check-that-sock-is-valid-before-iscsi.patch @@ -0,0 +1,48 @@ +From 7566df01331ec072ac684212d556129be880ba65 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Mar 2023 15:17:39 +0800 +Subject: scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param() + +From: Zhong Jinghua + +[ Upstream commit 48b19b79cfa37b1e50da3b5a8af529f994c08901 ] + +The validity of sock should be checked before assignment to avoid incorrect +values. Commit 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref +while calling getpeername()") introduced this change which may lead to +inconsistent values of tcp_sw_conn->sendpage and conn->datadgst_en. + +Fix the issue by moving the position of the assignment. + +Fixes: 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()") +Signed-off-by: Zhong Jinghua +Link: https://lore.kernel.org/r/20230329071739.2175268-1-zhongjinghua@huaweicloud.com +Reviewed-by: Mike Christie +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/iscsi_tcp.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c +index 252d7881f99c2..def9fac7aa4f4 100644 +--- a/drivers/scsi/iscsi_tcp.c ++++ b/drivers/scsi/iscsi_tcp.c +@@ -721,13 +721,12 @@ static int iscsi_sw_tcp_conn_set_param(struct iscsi_cls_conn *cls_conn, + iscsi_set_param(cls_conn, param, buf, buflen); + break; + case ISCSI_PARAM_DATADGST_EN: +- iscsi_set_param(cls_conn, param, buf, buflen); +- + mutex_lock(&tcp_sw_conn->sock_lock); + if (!tcp_sw_conn->sock) { + mutex_unlock(&tcp_sw_conn->sock_lock); + return -ENOTCONN; + } ++ iscsi_set_param(cls_conn, param, buf, buflen); + tcp_sw_conn->sendpage = conn->datadgst_en ? + sock_no_sendpage : tcp_sw_conn->sock->ops->sendpage; + mutex_unlock(&tcp_sw_conn->sock_lock); +-- +2.39.2 + diff --git a/queue-5.10/series b/queue-5.10/series index ed6a4de7ca6..e284dfe7edf 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -18,3 +18,6 @@ sunrpc-only-free-unix-grouplist-after-rcu-settles.patch nfsd-callback-request-does-not-use-correct-credentia.patch usb-xhci-tegra-fix-sleep-in-atomic-call.patch xhci-also-avoid-the-xhci_zero_64b_regs-quirk-with-a-passthrough-iommu.patch +iio-adc-ad7791-fix-irq-flags.patch +scsi-iscsi_tcp-check-that-sock-is-valid-before-iscsi.patch +perf-core-fix-the-same-task-check-in-perf_event_set_.patch