From: Greg Kroah-Hartman Date: Mon, 21 Apr 2025 11:40:50 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v6.1.135~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43de34b9a053b1759f60672edd88b56b46199195;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: asus-laptop-fix-an-uninitialized-variable.patch writeback-fix-false-warning-in-inode_to_wb.patch --- 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 index 0000000000..49d92eb6c3 --- /dev/null +++ b/queue-5.10/asus-laptop-fix-an-uninitialized-variable.patch @@ -0,0 +1,56 @@ +From 6c683c6887e4addcd6bd1ddce08cafccb0a21e32 Mon Sep 17 00:00:00 2001 +From: Denis Arefev +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 + +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 +Link: https://lore.kernel.org/r/20250403122603.18172-1-arefev@swemel.ru +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Greg Kroah-Hartman +--- + 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 diff --git a/queue-5.10/series b/queue-5.10/series index 8583be2e2a..e267df7ccd 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -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 index 0000000000..70dff41371 --- /dev/null +++ b/queue-5.10/writeback-fix-false-warning-in-inode_to_wb.patch @@ -0,0 +1,37 @@ +From 9e888998ea4d22257b07ce911576509486fa0667 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Sat, 12 Apr 2025 18:39:12 +0200 +Subject: writeback: fix false warning in inode_to_wb() + +From: Andreas Gruenbacher + +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 +Signed-off-by: Andreas Gruenbacher +Reviewed-by: Andreas Gruenbacher +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + 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)));