Skip to contentSkip to conversation

bpftool-ensure-task-comm-is-always-nul-terminated.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Nov 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: bpftool: ensure task comm is always NUL-terminated
has been removed from the -mm tree. Its filename was
bpftool-ensure-task-comm-is-always-nul-terminated.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Yafang Shao <[email protected]>
Subject: bpftool: ensure task comm is always NUL-terminated
Date: Mon, 7 Oct 2024 22:49:08 +0800

Let's explicitly ensure the destination string is NUL-terminated. This way, it won't be affected by changes to the source string.

Cc Alejandro Colomar <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Alexei Starovoitov <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc David Airlie <[email protected]>
Cc Eric Biederman <[email protected]>
Cc Eric Paris <[email protected]>
Cc James Morris <[email protected]>
Cc Jan Kara <[email protected]>
Cc Justin Stitt <[email protected]>
Cc Kees Cook <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Matus Jokay <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Ondrej Mosnacek <[email protected]>
Cc Paul Moore <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
Cc Simon Horman <[email protected]>
Cc Stephen Smalley <[email protected]>
Cc Steven Rostedt (Google) <[email protected]>
Cc Tetsuo Handa <[email protected]>
Cc Thomas Zimmermann <[email protected]>

---

 tools/bpf/bpftool/pids.c |    2 ++
 1 file changed, 2 insertions(+)
tools/bpf/bpftool/pids.c renamed from tools/bpf/bpftool/pids.c~bpftool-ensure-task-comm-is-always-nul-terminated +2 -0
@@ -54,6 +54,7 @@ static void add_ref(struct hashmap *map,
 		ref = &refs->refs[refs->ref_cnt];
 		ref->pid = e->pid;
 		memcpy(ref->comm, e->comm, sizeof(ref->comm));
+		ref->comm[sizeof(ref->comm) - 1] = '\0';
 		refs->ref_cnt++;
 
 		return;
@@ -77,6 +78,7 @@ static void add_ref(struct hashmap *map,
 	ref = &refs->refs[0];
 	ref->pid = e->pid;
 	memcpy(ref->comm, e->comm, sizeof(ref->comm));
+	ref->comm[sizeof(ref->comm) - 1] = '\0';
 	refs->ref_cnt = 1;
 	refs->has_bpf_cookie = e->has_bpf_cookie;
 	refs->bpf_cookie = e->bpf_cookie;

_

Patches currently in -mm which might be from [email protected] are