]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Apr 2025 11:40:50 +0000 (13:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Apr 2025 11:40:50 +0000 (13:40 +0200)
added patches:
asus-laptop-fix-an-uninitialized-variable.patch
writeback-fix-false-warning-in-inode_to_wb.patch

queue-5.10/asus-laptop-fix-an-uninitialized-variable.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/writeback-fix-false-warning-in-inode_to_wb.patch [new file with mode: 0644]

diff --git a/queue-5.10/asus-laptop-fix-an-uninitialized-variable.patch b/queue-5.10/asus-laptop-fix-an-uninitialized-variable.patch
new file mode 100644 (file)
index 0000000..49d92eb
--- /dev/null
@@ -0,0 +1,56 @@
+From 6c683c6887e4addcd6bd1ddce08cafccb0a21e32 Mon Sep 17 00:00:00 2001
+From: Denis Arefev <arefev@swemel.ru>
+Date: Thu, 3 Apr 2025 15:26:01 +0300
+Subject: asus-laptop: Fix an uninitialized variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Denis Arefev <arefev@swemel.ru>
+
+commit 6c683c6887e4addcd6bd1ddce08cafccb0a21e32 upstream.
+
+The value returned by acpi_evaluate_integer() is not checked,
+but the result is not always successful, so it is necessary to
+add a check of the returned value.
+
+If the result remains negative during three iterations of the loop,
+then the uninitialized variable 'val' will be used in the clamp_val()
+macro, so it must be initialized with the current value of the 'curr'
+variable.
+
+In this case, the algorithm should be less noisy.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: b23910c2194e ("asus-laptop: Pegatron Lucid accelerometer")
+Cc: stable@vger.kernel.org
+Signed-off-by: Denis Arefev <arefev@swemel.ru>
+Link: https://lore.kernel.org/r/20250403122603.18172-1-arefev@swemel.ru
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/asus-laptop.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/platform/x86/asus-laptop.c
++++ b/drivers/platform/x86/asus-laptop.c
+@@ -427,11 +427,14 @@ static int asus_pega_lucid_set(struct as
+ static int pega_acc_axis(struct asus_laptop *asus, int curr, char *method)
+ {
++      unsigned long long val = (unsigned long long)curr;
++      acpi_status status;
+       int i, delta;
+-      unsigned long long val;
+-      for (i = 0; i < PEGA_ACC_RETRIES; i++) {
+-              acpi_evaluate_integer(asus->handle, method, NULL, &val);
++      for (i = 0; i < PEGA_ACC_RETRIES; i++) {
++              status = acpi_evaluate_integer(asus->handle, method, NULL, &val);
++              if (ACPI_FAILURE(status))
++                      continue;
+               /* The output is noisy.  From reading the ASL
+                * dissassembly, timeout errors are returned with 1's
+                * in the high word, and the lack of locking around
index 8583be2e2a310382203e6d6f9167200fe47bbf77..e267df7ccdf2feb4d7322efe34a7e6e974e2bde1 100644 (file)
@@ -118,3 +118,5 @@ net-b53-enable-bpdu-reception-for-management-port.patch
 riscv-kgdb-do-not-inline-arch_kgdb_breakpoint.patch
 riscv-kgdb-remove-.option-norvc-.option-rvc-for-kgdb.patch
 cpufreq-sched-fix-the-usage-of-cpufreq_need_update_l.patch
+writeback-fix-false-warning-in-inode_to_wb.patch
+asus-laptop-fix-an-uninitialized-variable.patch
diff --git a/queue-5.10/writeback-fix-false-warning-in-inode_to_wb.patch b/queue-5.10/writeback-fix-false-warning-in-inode_to_wb.patch
new file mode 100644 (file)
index 0000000..70dff41
--- /dev/null
@@ -0,0 +1,37 @@
+From 9e888998ea4d22257b07ce911576509486fa0667 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruenba@redhat.com>
+Date: Sat, 12 Apr 2025 18:39:12 +0200
+Subject: writeback: fix false warning in inode_to_wb()
+
+From: Andreas Gruenbacher <agruenba@redhat.com>
+
+commit 9e888998ea4d22257b07ce911576509486fa0667 upstream.
+
+inode_to_wb() is used also for filesystems that don't support cgroup
+writeback.  For these filesystems inode->i_wb is stable during the
+lifetime of the inode (it points to bdi->wb) and there's no need to hold
+locks protecting the inode->i_wb dereference.  Improve the warning in
+inode_to_wb() to not trigger for these filesystems.
+
+Link: https://lkml.kernel.org/r/20250412163914.3773459-3-agruenba@redhat.com
+Fixes: aaa2cacf8184 ("writeback: add lockdep annotation to inode_to_wb()")
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
+Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/backing-dev.h |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/linux/backing-dev.h
++++ b/include/linux/backing-dev.h
+@@ -281,6 +281,7 @@ static inline struct bdi_writeback *inod
+ {
+ #ifdef CONFIG_LOCKDEP
+       WARN_ON_ONCE(debug_locks &&
++                   (inode->i_sb->s_iflags & SB_I_CGROUPWB) &&
+                    (!lockdep_is_held(&inode->i_lock) &&
+                     !lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) &&
+                     !lockdep_is_held(&inode->i_wb->list_lock)));