From: Greg Kroah-Hartman Date: Tue, 3 Feb 2026 14:50:57 +0000 (+0100) Subject: 6.18-stable patches X-Git-Tag: v5.10.249~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04561375d27a64b2518b4102929897132ec681eb;p=thirdparty%2Fkernel%2Fstable-queue.git 6.18-stable patches added patches: libbpf-fix-wdiscarded-qualifiers-under-c23.patch --- diff --git a/queue-6.18/libbpf-fix-wdiscarded-qualifiers-under-c23.patch b/queue-6.18/libbpf-fix-wdiscarded-qualifiers-under-c23.patch new file mode 100644 index 0000000000..a6715bc0ac --- /dev/null +++ b/queue-6.18/libbpf-fix-wdiscarded-qualifiers-under-c23.patch @@ -0,0 +1,63 @@ +From d70f79fef65810faf64dbae1f3a1b5623cdb2345 Mon Sep 17 00:00:00 2001 +From: Mikhail Gavrilov +Date: Sat, 6 Dec 2025 14:28:25 +0500 +Subject: libbpf: Fix -Wdiscarded-qualifiers under C23 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mikhail Gavrilov + +commit d70f79fef65810faf64dbae1f3a1b5623cdb2345 upstream. + +glibc ≥ 2.42 (GCC 15) defaults to -std=gnu23, which promotes +-Wdiscarded-qualifiers to an error. + +In C23, strstr() and strchr() return "const char *". + +Change variable types to const char * where the pointers are never +modified (res, sym_sfx, next_path). + +Suggested-by: Florian Weimer +Suggested-by: Andrii Nakryiko +Signed-off-by: Mikhail Gavrilov +Link: https://lore.kernel.org/r/20251206092825.1471385-1-mikhail.v.gavrilov@gmail.com +Signed-off-by: Alexei Starovoitov +[ shung-hsi.yu: needed to fix kernel build failure due to libbpf since glibc + 2.43+ (which adds 'const' qualifier to strstr) ] +Signed-off-by: Shung-Hsi Yu +Signed-off-by: Greg Kroah-Hartman +--- + tools/lib/bpf/libbpf.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/tools/lib/bpf/libbpf.c ++++ b/tools/lib/bpf/libbpf.c +@@ -8245,7 +8245,7 @@ static int kallsyms_cb(unsigned long lon + struct bpf_object *obj = ctx; + const struct btf_type *t; + struct extern_desc *ext; +- char *res; ++ const char *res; + + res = strstr(sym_name, ".llvm."); + if (sym_type == 'd' && res) +@@ -11574,7 +11574,8 @@ static int avail_kallsyms_cb(unsigned lo + * + * [0] fb6a421fb615 ("kallsyms: Match symbols exactly with CONFIG_LTO_CLANG") + */ +- char sym_trim[256], *psym_trim = sym_trim, *sym_sfx; ++ char sym_trim[256], *psym_trim = sym_trim; ++ const char *sym_sfx; + + if (!(sym_sfx = strstr(sym_name, ".llvm."))) + return 0; +@@ -12159,7 +12160,7 @@ static int resolve_full_path(const char + if (!search_paths[i]) + continue; + for (s = search_paths[i]; s != NULL; s = strchr(s, ':')) { +- char *next_path; ++ const char *next_path; + int seg_len; + + if (s[0] == ':') diff --git a/queue-6.18/series b/queue-6.18/series index 934bc901d1..de91861186 100644 --- a/queue-6.18/series +++ b/queue-6.18/series @@ -114,3 +114,4 @@ drm-amdgpu-fix-null-pointer-dereference-in-amdgpu_gmc_filter_faults_remove.patch drm-amdgpu-fix-cond_exec-handling-in-amdgpu_ib_schedule.patch iommu-tegra241-cmdqv-reset-vcmdq-in-tegra241_vcmdq_hw_init_user.patch gpiolib-acpi-fix-potential-out-of-boundary-left-shift.patch +libbpf-fix-wdiscarded-qualifiers-under-c23.patch