From: Greg Kroah-Hartman Date: Mon, 27 Oct 2025 11:54:03 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v5.4.301~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70b25264fa93e90f94639117055318274fcd64ff;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: fsdax-fix-infinite-loop-in-dax_iomap_rw.patch net-rtnetlink-fix-module-reference-count-leak-issue-in-rtnetlink_rcv_msg.patch risc-v-don-t-fail-in-riscv_of_parent_hartid-for-disabled-harts.patch --- diff --git a/queue-5.10/fsdax-fix-infinite-loop-in-dax_iomap_rw.patch b/queue-5.10/fsdax-fix-infinite-loop-in-dax_iomap_rw.patch new file mode 100644 index 0000000000..43c48d28c6 --- /dev/null +++ b/queue-5.10/fsdax-fix-infinite-loop-in-dax_iomap_rw.patch @@ -0,0 +1,57 @@ +From 17d9c15c9b9e7fb285f7ac5367dfb5f00ff575e3 Mon Sep 17 00:00:00 2001 +From: Li Jinlin +Date: Mon, 25 Jul 2022 11:20:50 +0800 +Subject: fsdax: Fix infinite loop in dax_iomap_rw() + +From: Li Jinlin + +commit 17d9c15c9b9e7fb285f7ac5367dfb5f00ff575e3 upstream. + +I got an infinite loop and a WARNING report when executing a tail command +in virtiofs. + + WARNING: CPU: 10 PID: 964 at fs/iomap/iter.c:34 iomap_iter+0x3a2/0x3d0 + Modules linked in: + CPU: 10 PID: 964 Comm: tail Not tainted 5.19.0-rc7 + Call Trace: + + dax_iomap_rw+0xea/0x620 + ? __this_cpu_preempt_check+0x13/0x20 + fuse_dax_read_iter+0x47/0x80 + fuse_file_read_iter+0xae/0xd0 + new_sync_read+0xfe/0x180 + ? 0xffffffff81000000 + vfs_read+0x14d/0x1a0 + ksys_read+0x6d/0xf0 + __x64_sys_read+0x1a/0x20 + do_syscall_64+0x3b/0x90 + entry_SYSCALL_64_after_hwframe+0x63/0xcd + +The tail command will call read() with a count of 0. In this case, +iomap_iter() will report this WARNING, and always return 1 which casuing +the infinite loop in dax_iomap_rw(). + +Fixing by checking count whether is 0 in dax_iomap_rw(). + +Fixes: ca289e0b95af ("fsdax: switch dax_iomap_rw to use iomap_iter") +Signed-off-by: Li Jinlin +Reviewed-by: Darrick J. Wong +Link: https://lore.kernel.org/r/20220725032050.3873372-1-lijinlin3@huawei.com +Signed-off-by: Dan Williams +Signed-off-by: Greg Kroah-Hartman +--- + fs/dax.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/fs/dax.c ++++ b/fs/dax.c +@@ -1219,6 +1219,9 @@ dax_iomap_rw(struct kiocb *iocb, struct + loff_t done = 0; + int ret; + ++ if (!iomi.len) ++ return 0; ++ + if (iov_iter_rw(iter) == WRITE) { + lockdep_assert_held_write(&iomi.inode->i_rwsem); + iomi.flags |= IOMAP_WRITE; diff --git a/queue-5.10/net-rtnetlink-fix-module-reference-count-leak-issue-in-rtnetlink_rcv_msg.patch b/queue-5.10/net-rtnetlink-fix-module-reference-count-leak-issue-in-rtnetlink_rcv_msg.patch new file mode 100644 index 0000000000..d855bb278f --- /dev/null +++ b/queue-5.10/net-rtnetlink-fix-module-reference-count-leak-issue-in-rtnetlink_rcv_msg.patch @@ -0,0 +1,33 @@ +From 5b22f62724a0a09e00d301abf5b57b0c12be8a16 Mon Sep 17 00:00:00 2001 +From: Zhengchao Shao +Date: Mon, 15 Aug 2022 10:46:29 +0800 +Subject: net: rtnetlink: fix module reference count leak issue in rtnetlink_rcv_msg + +From: Zhengchao Shao + +commit 5b22f62724a0a09e00d301abf5b57b0c12be8a16 upstream. + +When bulk delete command is received in the rtnetlink_rcv_msg function, +if bulk delete is not supported, module_put is not called to release +the reference counting. As a result, module reference count is leaked. + +Fixes: a6cec0bcd342 ("net: rtnetlink: add bulk delete support flag") +Signed-off-by: Zhengchao Shao +Acked-by: Nikolay Aleksandrov +Link: https://lore.kernel.org/r/20220815024629.240367-1-shaozhengchao@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/core/rtnetlink.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/core/rtnetlink.c ++++ b/net/core/rtnetlink.c +@@ -5624,6 +5624,7 @@ static int rtnetlink_rcv_msg(struct sk_b + if (kind == RTNL_KIND_DEL && (nlh->nlmsg_flags & NLM_F_BULK) && + !(flags & RTNL_FLAG_BULK_DEL_SUPPORTED)) { + NL_SET_ERR_MSG(extack, "Bulk delete is not supported"); ++ module_put(owner); + goto err_unlock; + } + diff --git a/queue-5.10/risc-v-don-t-fail-in-riscv_of_parent_hartid-for-disabled-harts.patch b/queue-5.10/risc-v-don-t-fail-in-riscv_of_parent_hartid-for-disabled-harts.patch new file mode 100644 index 0000000000..62c00fcb73 --- /dev/null +++ b/queue-5.10/risc-v-don-t-fail-in-riscv_of_parent_hartid-for-disabled-harts.patch @@ -0,0 +1,51 @@ +From c4676f8dc1e12e68d6511f9ed89707fdad4c962c Mon Sep 17 00:00:00 2001 +From: Anup Patel +Date: Fri, 27 Oct 2023 21:12:53 +0530 +Subject: RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs + +From: Anup Patel + +commit c4676f8dc1e12e68d6511f9ed89707fdad4c962c upstream. + +The riscv_of_processor_hartid() used by riscv_of_parent_hartid() fails +for HARTs disabled in the DT. This results in the following warning +thrown by the RISC-V INTC driver for the E-core on SiFive boards: + +[ 0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller + +The riscv_of_parent_hartid() is only expected to read the hartid +from the DT so we directly call of_get_cpu_hwid() instead of calling +riscv_of_processor_hartid(). + +Fixes: ad635e723e17 ("riscv: cpu: Add 64bit hartid support on RV64") +Signed-off-by: Anup Patel +Reviewed-by: Atish Patra +Link: https://lore.kernel.org/r/20231027154254.355853-2-apatel@ventanamicro.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/kernel/cpu.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/arch/riscv/kernel/cpu.c ++++ b/arch/riscv/kernel/cpu.c +@@ -50,13 +50,14 @@ int riscv_of_processor_hartid(struct dev + */ + int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid) + { +- int rc; +- + for (; node; node = node->parent) { + if (of_device_is_compatible(node, "riscv")) { +- rc = riscv_of_processor_hartid(node, hartid); +- if (!rc) +- return 0; ++ *hartid = (unsigned long)of_get_cpu_hwid(node, 0); ++ if (*hartid == ~0UL) { ++ pr_warn("Found CPU without hart ID\n"); ++ return -ENODEV; ++ } ++ return 0; + } + } + diff --git a/queue-5.10/series b/queue-5.10/series index d463cb80d3..a3dc27daa8 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -327,3 +327,6 @@ vfs-don-t-leak-disconnected-dentries-on-umount.patch nfsd-define-a-proc_layoutcommit-for-the-flexfiles-layout-type.patch fuse-fix-livelock-in-synchronous-file-put-from-fuseblk-workers.patch arch_topology-fix-incorrect-error-check-in-topology_parse_cpu_capacity.patch +net-rtnetlink-fix-module-reference-count-leak-issue-in-rtnetlink_rcv_msg.patch +risc-v-don-t-fail-in-riscv_of_parent_hartid-for-disabled-harts.patch +fsdax-fix-infinite-loop-in-dax_iomap_rw.patch