]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Dec 2024 12:09:06 +0000 (13:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Dec 2024 12:09:06 +0000 (13:09 +0100)
added patches:
ad7780-fix-division-by-zero-in-ad7780_write_raw.patch
s390-entry-mark-irq-entries-to-fix-stack-depot-warnings.patch

queue-5.15/ad7780-fix-division-by-zero-in-ad7780_write_raw.patch [new file with mode: 0644]
queue-5.15/s390-entry-mark-irq-entries-to-fix-stack-depot-warnings.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/ad7780-fix-division-by-zero-in-ad7780_write_raw.patch b/queue-5.15/ad7780-fix-division-by-zero-in-ad7780_write_raw.patch
new file mode 100644 (file)
index 0000000..cb06648
--- /dev/null
@@ -0,0 +1,35 @@
+From c174b53e95adf2eece2afc56cd9798374919f99a Mon Sep 17 00:00:00 2001
+From: Zicheng Qu <quzicheng@huawei.com>
+Date: Mon, 28 Oct 2024 14:20:27 +0000
+Subject: ad7780: fix division by zero in ad7780_write_raw()
+
+From: Zicheng Qu <quzicheng@huawei.com>
+
+commit c174b53e95adf2eece2afc56cd9798374919f99a upstream.
+
+In the ad7780_write_raw() , val2 can be zero, which might lead to a
+division by zero error in DIV_ROUND_CLOSEST(). The ad7780_write_raw()
+is based on iio_info's write_raw. While val is explicitly declared that
+can be zero (in read mode), val2 is not specified to be non-zero.
+
+Fixes: 9085daa4abcc ("staging: iio: ad7780: add gain & filter gpio support")
+Cc: stable@vger.kernel.org
+Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
+Link: https://patch.msgid.link/20241028142027.1032332-1-quzicheng@huawei.com
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/adc/ad7780.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/ad7780.c
++++ b/drivers/iio/adc/ad7780.c
+@@ -152,7 +152,7 @@ static int ad7780_write_raw(struct iio_d
+       switch (m) {
+       case IIO_CHAN_INFO_SCALE:
+-              if (val != 0)
++              if (val != 0 || val2 == 0)
+                       return -EINVAL;
+               vref = st->int_vref_mv * 1000000LL;
diff --git a/queue-5.15/s390-entry-mark-irq-entries-to-fix-stack-depot-warnings.patch b/queue-5.15/s390-entry-mark-irq-entries-to-fix-stack-depot-warnings.patch
new file mode 100644 (file)
index 0000000..ce839a8
--- /dev/null
@@ -0,0 +1,89 @@
+From 45c9f2b856a075a34873d00788d2e8a250c1effd Mon Sep 17 00:00:00 2001
+From: Vasily Gorbik <gor@linux.ibm.com>
+Date: Tue, 19 Nov 2024 14:54:07 +0100
+Subject: s390/entry: Mark IRQ entries to fix stack depot warnings
+
+From: Vasily Gorbik <gor@linux.ibm.com>
+
+commit 45c9f2b856a075a34873d00788d2e8a250c1effd upstream.
+
+The stack depot filters out everything outside of the top interrupt
+context as an uninteresting or irrelevant part of the stack traces. This
+helps with stack trace de-duplication, avoiding an explosion of saved
+stack traces that share the same IRQ context code path but originate
+from different randomly interrupted points, eventually exhausting the
+stack depot.
+
+Filtering uses in_irqentry_text() to identify functions within the
+.irqentry.text and .softirqentry.text sections, which then become the
+last stack trace entries being saved.
+
+While __do_softirq() is placed into the .softirqentry.text section by
+common code, populating .irqentry.text is architecture-specific.
+
+Currently, the .irqentry.text section on s390 is empty, which prevents
+stack depot filtering and de-duplication and could result in warnings
+like:
+
+Stack depot reached limit capacity
+WARNING: CPU: 0 PID: 286113 at lib/stackdepot.c:252 depot_alloc_stack+0x39a/0x3c8
+
+with PREEMPT and KASAN enabled.
+
+Fix this by moving the IO/EXT interrupt handlers from .kprobes.text into
+the .irqentry.text section and updating the kprobes blacklist to include
+the .irqentry.text section.
+
+This is done only for asynchronous interrupts and explicitly not for
+program checks, which are synchronous and where the context beyond the
+program check is important to preserve. Despite machine checks being
+somewhat in between, they are extremely rare, and preserving context
+when possible is also of value.
+
+SVCs and Restart Interrupts are not relevant, one being always at the
+boundary to user space and the other being a one-time thing.
+
+IRQ entries filtering is also optionally used in ftrace function graph,
+where the same logic applies.
+
+Cc: stable@vger.kernel.org # 5.15+
+Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/s390/kernel/entry.S   |    4 ++++
+ arch/s390/kernel/kprobes.c |    6 ++++++
+ 2 files changed, 10 insertions(+)
+
+--- a/arch/s390/kernel/entry.S
++++ b/arch/s390/kernel/entry.S
+@@ -474,9 +474,13 @@ ENTRY(\name)
+ ENDPROC(\name)
+ .endm
++      .section .irqentry.text, "ax"
++
+ INT_HANDLER ext_int_handler,__LC_EXT_OLD_PSW,do_ext_irq
+ INT_HANDLER io_int_handler,__LC_IO_OLD_PSW,do_io_irq
++      .section .kprobes.text, "ax"
++
+ /*
+  * Load idle PSW.
+  */
+--- a/arch/s390/kernel/kprobes.c
++++ b/arch/s390/kernel/kprobes.c
+@@ -518,6 +518,12 @@ int __init arch_init_kprobes(void)
+       return register_kprobe(&trampoline);
+ }
++int __init arch_populate_kprobe_blacklist(void)
++{
++      return kprobe_add_area_blacklist((unsigned long)__irqentry_text_start,
++                                       (unsigned long)__irqentry_text_end);
++}
++
+ int arch_trampoline_kprobe(struct kprobe *p)
+ {
+       return p->addr == (kprobe_opcode_t *) &kretprobe_trampoline;
index d54d3d31d154d63d93099d79392f6ee2f2e3219c..a3c7b5e69af36d77d3aeadcc76de3e79c7defd57 100644 (file)
@@ -381,3 +381,5 @@ quota-flush-quota_release_work-upon-quota-writeback.patch
 btrfs-add-might_sleep-annotations.patch
 btrfs-add-a-sanity-check-for-btrfs-root-in-btrfs_sea.patch
 btrfs-ref-verify-fix-use-after-free-after-invalid-re.patch
+ad7780-fix-division-by-zero-in-ad7780_write_raw.patch
+s390-entry-mark-irq-entries-to-fix-stack-depot-warnings.patch