From: Greg Kroah-Hartman Date: Mon, 30 Dec 2024 08:30:21 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v6.1.123~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35bc6b6446b98a5aca2dae7c8008cd9891799217;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: tracing-constify-string-literal-data-member-in-struct-trace_event_call.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index 11308a0aa41..0e5ddb8af8b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -55,3 +55,4 @@ ipv6-use-skb_expand_head-in-ip6_finish_output2.patch ipv6-use-skb_expand_head-in-ip6_xmit.patch ipv6-fix-possible-uaf-in-ip6_finish_output2.patch bpf-fix-recursive-lock-when-verdict-program-return-s.patch +tracing-constify-string-literal-data-member-in-struct-trace_event_call.patch diff --git a/queue-5.4/tracing-constify-string-literal-data-member-in-struct-trace_event_call.patch b/queue-5.4/tracing-constify-string-literal-data-member-in-struct-trace_event_call.patch new file mode 100644 index 00000000000..b6e1eca21ce --- /dev/null +++ b/queue-5.4/tracing-constify-string-literal-data-member-in-struct-trace_event_call.patch @@ -0,0 +1,66 @@ +From 452f4b31e3f70a52b97890888eeb9eaa9a87139a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= +Date: Mon, 25 Nov 2024 11:50:25 +0100 +Subject: tracing: Constify string literal data member in struct trace_event_call +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian Göttsche + +commit 452f4b31e3f70a52b97890888eeb9eaa9a87139a upstream. + +The name member of the struct trace_event_call is assigned with +generated string literals; declare them pointer to read-only. + +Reported by clang: + + security/landlock/syscalls.c:179:1: warning: initializing 'char *' with an expression of type 'const char[34]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] + 179 | SYSCALL_DEFINE3(landlock_create_ruleset, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 180 | const struct landlock_ruleset_attr __user *const, attr, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 181 | const size_t, size, const __u32, flags) + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./include/linux/syscalls.h:226:36: note: expanded from macro 'SYSCALL_DEFINE3' + 226 | #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./include/linux/syscalls.h:234:2: note: expanded from macro 'SYSCALL_DEFINEx' + 234 | SYSCALL_METADATA(sname, x, __VA_ARGS__) \ + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./include/linux/syscalls.h:184:2: note: expanded from macro 'SYSCALL_METADATA' + 184 | SYSCALL_TRACE_ENTER_EVENT(sname); \ + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./include/linux/syscalls.h:151:30: note: expanded from macro 'SYSCALL_TRACE_ENTER_EVENT' + 151 | .name = "sys_enter"#sname, \ + | ^~~~~~~~~~~~~~~~~ + +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Mathieu Desnoyers +Cc: Mickaël Salaün +Cc: Günther Noack +Cc: Nathan Chancellor +Cc: Nick Desaulniers +Cc: Bill Wendling +Cc: Justin Stitt +Link: https://lore.kernel.org/20241125105028.42807-1-cgoettsche@seltendoof.de +Fixes: b77e38aa240c3 ("tracing: add event trace infrastructure") +Signed-off-by: Christian Göttsche +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/trace_events.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -255,7 +255,7 @@ struct trace_event_call { + struct list_head list; + struct trace_event_class *class; + union { +- char *name; ++ const char *name; + /* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */ + struct tracepoint *tp; + };