]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Mon, 10 Apr 2023 12:34:54 +0000 (08:34 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 10 Apr 2023 12:34:54 +0000 (08:34 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/iio-adc-ad7791-fix-irq-flags.patch [new file with mode: 0644]
queue-5.10/perf-core-fix-the-same-task-check-in-perf_event_set_.patch [new file with mode: 0644]
queue-5.10/scsi-iscsi_tcp-check-that-sock-is-valid-before-iscsi.patch [new file with mode: 0644]
queue-5.10/series

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 (file)
index 0000000..821a348
--- /dev/null
@@ -0,0 +1,40 @@
+From 0f1590590522465add53b7bd4fc5e85e1ca2022f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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á <nuno.sa@analog.com>
+
+[ 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á <nuno.sa@analog.com>
+Link: https://lore.kernel.org/r/20230120124645.819910-1-nuno.sa@analog.com
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 (file)
index 0000000..537229a
--- /dev/null
@@ -0,0 +1,73 @@
+From e7d2d5189a69dd4209a0151be372d027ceaa6087 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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 <kan.liang@linux.intel.com>
+
+[ 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 <kan.liang@linux.intel.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reviewed-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
+Link: https://lkml.kernel.org/r/20230322202449.512091-1-kan.liang@linux.intel.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 (file)
index 0000000..49156ba
--- /dev/null
@@ -0,0 +1,48 @@
+From 7566df01331ec072ac684212d556129be880ba65 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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 <zhongjinghua@huawei.com>
+
+[ 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 <zhongjinghua@huawei.com>
+Link: https://lore.kernel.org/r/20230329071739.2175268-1-zhongjinghua@huaweicloud.com
+Reviewed-by: Mike Christie <michael.christie@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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
+
index ed6a4de7ca69a0b5bad138e9545fecedb3d80cd5..e284dfe7edf3a773aad95cb1ce20033244231dff 100644 (file)
@@ -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