From 7d6bb479666f2f47d6afe59f912a3a91728f1368 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 4 Jun 2025 15:15:44 +0200 Subject: [PATCH] 6.1-stable patches added patches: tracing-fix-compilation-warning-on-arm32.patch --- queue-6.1/series | 1 + ...ing-fix-compilation-warning-on-arm32.patch | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 queue-6.1/tracing-fix-compilation-warning-on-arm32.patch diff --git a/queue-6.1/series b/queue-6.1/series index ab5c3679ba..9b3efadaa5 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1 +1,2 @@ mm-uffd-fix-vma-operation-where-start-addr-cuts-part-of-vma.patch +tracing-fix-compilation-warning-on-arm32.patch diff --git a/queue-6.1/tracing-fix-compilation-warning-on-arm32.patch b/queue-6.1/tracing-fix-compilation-warning-on-arm32.patch new file mode 100644 index 0000000000..000adda986 --- /dev/null +++ b/queue-6.1/tracing-fix-compilation-warning-on-arm32.patch @@ -0,0 +1,52 @@ +From 2fbdb6d8e03b70668c0876e635506540ae92ab05 Mon Sep 17 00:00:00 2001 +From: Pan Taixi +Date: Mon, 26 May 2025 09:37:31 +0800 +Subject: tracing: Fix compilation warning on arm32 + +From: Pan Taixi + +commit 2fbdb6d8e03b70668c0876e635506540ae92ab05 upstream. + +On arm32, size_t is defined to be unsigned int, while PAGE_SIZE is +unsigned long. This hence triggers a compilation warning as min() +asserts the type of two operands to be equal. Casting PAGE_SIZE to size_t +solves this issue and works on other target architectures as well. + +Compilation warning details: + +kernel/trace/trace.c: In function 'tracing_splice_read_pipe': +./include/linux/minmax.h:20:28: warning: comparison of distinct pointer types lacks a cast + (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) + ^ +./include/linux/minmax.h:26:4: note: in expansion of macro '__typecheck' + (__typecheck(x, y) && __no_side_effects(x, y)) + ^~~~~~~~~~~ + +... + +kernel/trace/trace.c:6771:8: note: in expansion of macro 'min' + min((size_t)trace_seq_used(&iter->seq), + ^~~ + +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/20250526013731.1198030-1-pantaixi@huaweicloud.com +Fixes: f5178c41bb43 ("tracing: Fix oob write in trace_seq_to_buffer()") +Reviewed-by: Jeongjun Park +Signed-off-by: Pan Taixi +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + kernel/trace/trace.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -7050,7 +7050,7 @@ static ssize_t tracing_splice_read_pipe( + ret = trace_seq_to_buffer(&iter->seq, + page_address(spd.pages[i]), + min((size_t)trace_seq_used(&iter->seq), +- PAGE_SIZE)); ++ (size_t)PAGE_SIZE)); + if (ret < 0) { + __free_page(spd.pages[i]); + break; -- 2.47.2