* [PATCH] libbpf: Fix debian kernel version information parsing
@ 2026-08-31 13:45 Sudip Mukherjee
2026-08-31 14:33 ` bot+bpf-ci
2026-09-03 0:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2026-08-31 13:45 UTC (permalink / raw)
To: Andrii Nakryiko, Eduard Zingerman, Ihor Solodrai,
Alexei Starovoitov, Daniel Borkmann, Kumar Kartikeya Dwivedi,
Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
Emil Tsalapatis
Cc: bpf, linux-kernel, Sudip Mukherjee
Currently get_debian_kernel_version() expects the version to be in the
form of x.y.z but the Debian kernels uploaded to experimental are not
always LTS kernels. Like the current Debian kernel in experimental
is 7.2~rc7-1~exp1 and uname -v reported "Debian 7.2~rc7-1~exp1".
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
tools/lib/bpf/libbpf_probes.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/lib/bpf/libbpf_probes.c b/tools/lib/bpf/libbpf_probes.c
index e40819465ddc7..5acf0f84a40a1 100644
--- a/tools/lib/bpf/libbpf_probes.c
+++ b/tools/lib/bpf/libbpf_probes.c
@@ -62,7 +62,7 @@ static __u32 get_ubuntu_kernel_version(void)
*/
static __u32 get_debian_kernel_version(struct utsname *info)
{
- __u32 major, minor, patch;
+ __u32 major, minor, patch = 0;
char *p;
p = strstr(info->version, "Debian ");
@@ -71,10 +71,13 @@ static __u32 get_debian_kernel_version(struct utsname *info)
return 0;
}
- if (sscanf(p, "Debian %u.%u.%u", &major, &minor, &patch) != 3)
- return 0;
+ if (sscanf(p, "Debian %u.%u.%u", &major, &minor, &patch) == 3)
+ return KERNEL_VERSION(major, minor, patch);
- return KERNEL_VERSION(major, minor, patch);
+ if (sscanf(p, "Debian %u.%u", &major, &minor) == 2)
+ return KERNEL_VERSION(major, minor, patch);
+
+ return 0;
}
__u32 get_kernel_version(void)
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libbpf: Fix debian kernel version information parsing
2026-08-31 13:45 [PATCH] libbpf: Fix debian kernel version information parsing Sudip Mukherjee
@ 2026-08-31 14:33 ` bot+bpf-ci
2026-09-03 0:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: bot+bpf-ci @ 2026-08-31 14:33 UTC (permalink / raw)
To: sudipm.mukherjee, andrii, eddyz87, ihor.solodrai, ast, daniel,
memxor, martin.lau, song, yonghong.song, jolsa, emil
Cc: bpf, linux-kernel, sudipm.mukherjee, ast, andrii, daniel,
martin.lau, eddyz87, yonghong.song, mason, ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
> libbpf: Fix debian kernel version information parsing
>
> Currently get_debian_kernel_version() expects the version to be in the
> form of x.y.z but the Debian kernels uploaded to experimental are not
> always LTS kernels. Like the current Debian kernel in experimental
> is 7.2~rc7-1~exp1 and uname -v reported "Debian 7.2~rc7-1~exp1".
>
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
This looks like a bug fix for get_debian_kernel_version() that was added
in an earlier commit. Should this include:
Fixes: d1d7730ff875 ("libbpf: Correctly set the kernel code version in Debian kernel.")
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/33399492426
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libbpf: Fix debian kernel version information parsing
2026-08-31 13:45 [PATCH] libbpf: Fix debian kernel version information parsing Sudip Mukherjee
2026-08-31 14:33 ` bot+bpf-ci
@ 2026-09-03 0:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-03 0:30 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: andrii, eddyz87, ihor.solodrai, ast, daniel, memxor, martin.lau,
song, yonghong.song, jolsa, emil, bpf, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Mon, 31 Aug 2026 14:45:37 +0100 you wrote:
> Currently get_debian_kernel_version() expects the version to be in the
> form of x.y.z but the Debian kernels uploaded to experimental are not
> always LTS kernels. Like the current Debian kernel in experimental
> is 7.2~rc7-1~exp1 and uname -v reported "Debian 7.2~rc7-1~exp1".
>
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
>
> [...]
Here is the summary with links:
- libbpf: Fix debian kernel version information parsing
https://git.kernel.org/bpf/bpf-next/c/7bf591f26545
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-03 0:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 13:45 [PATCH] libbpf: Fix debian kernel version information parsing Sudip Mukherjee
2026-08-31 14:33 ` bot+bpf-ci
2026-09-03 0:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox