* [PATCH v5 0/6] sched: Add support for long task name
@ 2026-08-27 18:22 André Almeida
2026-08-27 18:23 ` [PATCH v5 1/6] treewide: Get rid of get_task_comm() André Almeida
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:22 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
* Use case
When debugging and tracing complex programs with hundreds of threads, 16 bytes
long thread names are not enough anymore. cmd_line can show a lot of
characters, but it's not affected by pthread_setname_np() or
prctl(PR_SET_NAME), so let's give the same love kthreads got with commit
6b59808bfe48 ("workqueue: Show the latest workqueue name in
/proc/PID/{comm,stat,status}"). This patchset creates a new
PR_{SET,GET}_EXT_NAME that supports 64 bytes long names.
It also introduces a new function copy_task_comm() that ensures that the string
is always NUL-terminated despite of mismatching sizes of buffers. We can't just
use strscpy() because it proved to give some overhead [0] in tracing.
* Patchset
Patch 1 and 2 do some prep work in order to avoid buffer overflows around
the kernel, now that current->comm is bigger. It also make sure that if
the destination buffer is smaller than TASK_COMM_EXT_LEN, it will
be NUL-terminated.
Patch 3 adds a KUnit for the new function copy_task_comm()
Patch 4 sets current->comm length to TASK_COMM_EXT_LEN and take care of
making sure that current userspace APIs gets only TASK_COMM_LEN.
Patch 5 creates new prctl() to set and get all the TASK_COMM_EXT_LEN bytes.
Patch 6 adapts the existing selftest for this new interface.
* Testing
selftests/prctl/set-process-name.c survives this patchset, and it was extended
to the new interface. KUnit test was modified to support copy_task_comm().
I ran the same benchmark as at [0], and no significant change was found.
* Changes
Since v4:
- Remove copy_task_comm() calls for structs other than struct task_struct
- copy_task_comm(): Add checks for len > TASK_COMM_LEN and len < 0
- Link to v4: https://patch.msgid.link/20260717-tonyk-long_name-v4-0-1fedfc870d21@igalia.com
Since v3:
- Simplify Get rid of get_task_comm() commit
- Simplify copy_task_comm(): just do a memcpy + NUL char at the end
- Link to v3: https://patch.msgid.link/20260612-tonyk-long_name-v3-0-7989b66e8a99@igalia.com
Since v2:
- Add a custom function copy_task_comm() that uses memcpy when possible and
fallback to strscpy(). It always ensures that the string in NUL-terminated
- Add KUnit test for the new function
- Link to v2: https://patch.msgid.link/20260524-tonyk-long_name-v2-0-332f6bd041c4@igalia.com
Since v1:
- Replace new strtostr() with strscpy()
- Don't replace memcpy in tools/
- Link to v1: https://patch.msgid.link/20260517-tonyk-long_name-v1-0-3c282eaa91e2@igalia.com
[0] https://lore.kernel.org/lkml/20260526190625.3f4aca0a@gandalf.local.home/
---
André Almeida (6):
treewide: Get rid of get_task_comm()
treewide: Replace memcpy(..., current->comm) with copy_task_comm()
lib/string_kunit: Add test for copy_task_comm()
sched: Extend task command name with TASK_COMM_EXT_LEN
prctl: Add support for long user thread names
selftests: prctl: Add test for long thread names
drivers/connector/cn_proc.c | 2 +-
drivers/dma-buf/sw_sync.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +--
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
drivers/gpu/drm/lima/lima_ctx.c | 2 +-
drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +-
drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
drivers/gpu/drm/panthor/panthor_sched.c | 2 +-
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
drivers/hwtracing/stm/core.c | 2 +-
drivers/tty/tty_audit.c | 2 +-
fs/binfmt_elf.c | 2 +-
fs/binfmt_elf_fdpic.c | 2 +-
fs/proc/array.c | 2 +-
include/linux/coredump.h | 2 +-
include/linux/sched.h | 33 +++++++++----------
include/linux/tracepoint.h | 4 +--
include/trace/events/block.h | 10 +++---
include/trace/events/coredump.h | 2 +-
include/trace/events/f2fs.h | 4 +--
include/trace/events/oom.h | 2 +-
include/trace/events/osnoise.h | 2 +-
include/trace/events/sched.h | 10 +++---
include/trace/events/signal.h | 2 +-
include/trace/events/task.h | 4 +--
include/uapi/linux/prctl.h | 3 ++
kernel/audit.c | 6 ++--
kernel/auditsc.c | 6 ++--
kernel/printk/printk.c | 2 +-
kernel/sys.c | 23 ++++++++++---
lib/tests/string_kunit.c | 38 ++++++++++++++++++++++
net/bluetooth/hci_sock.c | 2 +-
net/netfilter/nf_tables_api.c | 4 ++-
security/integrity/integrity_audit.c | 3 +-
security/ipe/audit.c | 3 +-
security/landlock/domain.c | 2 +-
security/lsm_audit.c | 7 ++--
tools/testing/selftests/prctl/set-process-name.c | 37 +++++++++++++++++++++
42 files changed, 173 insertions(+), 76 deletions(-)
---
base-commit: 73e3f0710014fe6d4ed98cfc02292f6121db7558
change-id: 20260516-tonyk-long_name-b9f345aeb041
Best regards,
--
André Almeida <andrealmeid@igalia.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v5 1/6] treewide: Get rid of get_task_comm()
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 18:40 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm() André Almeida
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
Since commit 4cc0473d7754 ("get rid of __get_task_comm()"),
get_task_comm() does just a redundant check for the buffer size and call
strscpy_pad(). Replace get_task_comm() calls with strscpy_pad(), that will
do the right thing if the buffers sizes doesn't match: zero-pad if it's
bigger, and truncate if it's smaller.
Link: https://lore.kernel.org/lkml/CAHk-=wi5c=_-FBGo_88CowJd_F-Gi6Ud9d=TALm65ReN7YjrMw@mail.gmail.com/
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
Changes from v1:
- Fix for security/ipe/audit.c and net/netfilter/nf_tables_api.c
---
drivers/connector/cn_proc.c | 2 +-
drivers/dma-buf/sw_sync.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
drivers/gpu/drm/lima/lima_ctx.c | 2 +-
drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +-
drivers/gpu/drm/panthor/panthor_gem.c | 2 +-
drivers/gpu/drm/panthor/panthor_sched.c | 2 +-
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
drivers/hwtracing/stm/core.c | 2 +-
drivers/tty/tty_audit.c | 2 +-
fs/binfmt_elf.c | 2 +-
fs/binfmt_elf_fdpic.c | 2 +-
fs/proc/array.c | 2 +-
include/linux/sched.h | 19 -------------------
kernel/audit.c | 6 ++++--
kernel/auditsc.c | 6 ++++--
kernel/printk/printk.c | 2 +-
kernel/sys.c | 2 +-
net/bluetooth/hci_sock.c | 2 +-
net/netfilter/nf_tables_api.c | 4 +++-
security/integrity/integrity_audit.c | 3 ++-
security/ipe/audit.c | 3 ++-
security/landlock/domain.c | 2 +-
security/lsm_audit.c | 7 ++++---
29 files changed, 42 insertions(+), 52 deletions(-)
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 0056ab81fbc3..c78243ed3c2a 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -278,7 +278,7 @@ void proc_comm_connector(struct task_struct *task)
ev->what = PROC_EVENT_COMM;
ev->event_data.comm.process_pid = task->pid;
ev->event_data.comm.process_tgid = task->tgid;
- get_task_comm(ev->event_data.comm.comm, task);
+ strscpy_pad(ev->event_data.comm.comm, task->comm);
memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
msg->ack = 0; /* not used */
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 8df20b0218a9..d501657ad801 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -312,7 +312,7 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file)
struct sync_timeline *obj;
char task_comm[TASK_COMM_LEN];
- get_task_comm(task_comm, current);
+ strscpy_pad(task_comm, current->comm);
obj = sync_timeline_create(task_comm);
if (!obj)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
index 9b10d015671c..2c92bb12c269 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
@@ -73,7 +73,7 @@ struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
/* This reference gets released in amdkfd_fence_release */
mmgrab(mm);
fence->mm = mm;
- get_task_comm(fence->timeline_name, current);
+ strscpy_pad(fence->timeline_name, current->comm);
spin_lock_init(&fence->lock);
fence->context_id = context_id;
dma_fence_init(&fence->base, &amdkfd_fence_ops, &fence->lock,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
index f6b7522c3c82..046243e3a3cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
@@ -128,7 +128,7 @@ int amdgpu_evf_mgr_rearm(struct amdgpu_eviction_fence_mgr *evf_mgr,
return -ENOMEM;
ev_fence->evf_mgr = evf_mgr;
- get_task_comm(ev_fence->timeline_name, current);
+ strscpy_pad(ev_fence->timeline_name, current->comm);
spin_lock_init(&ev_fence->lock);
dma_fence_init64(&ev_fence->base, &amdgpu_eviction_fence_ops,
&ev_fence->lock, evf_mgr->ev_fence_ctx,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 35eb87591740..6f140025a5f3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3687,7 +3687,7 @@ int amdgpu_ras_init(struct amdgpu_device *adev)
}
con->init_task_pid = task_pid_nr(current);
- get_task_comm(con->init_task_comm, current);
+ strscpy_pad(con->init_task_comm, current->comm);
mutex_init(&con->critical_region_lock);
INIT_LIST_HEAD(&con->critical_region_head);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 7e80442ec3e5..cd4d1aef97c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -85,7 +85,7 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev,
fence_drv->adev = adev;
fence_drv->context = dma_fence_context_alloc(1);
- get_task_comm(fence_drv->timeline_name, current);
+ strscpy_pad(fence_drv->timeline_name, current->comm);
*fence_drv_req = fence_drv;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index d2ad5b0e8759..017e9b27c336 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2572,10 +2572,10 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
return;
vm->task_info->task.pid = current->pid;
- get_task_comm(vm->task_info->task.comm, current);
+ strscpy_pad(vm->task_info->task.comm, current->comm);
vm->task_info->tgid = current->tgid;
- get_task_comm(vm->task_info->process_name, current->group_leader);
+ strscpy_pad(vm->task_info->process_name, current->group_leader->comm);
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 249f07f30951..d6f32bc44aef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -565,7 +565,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
}
vres->task.pid = task_pid_nr(current);
- get_task_comm(vres->task.comm, current);
+ strscpy_pad(vres->task.comm, current->comm);
list_add_tail(&vres->vres_node, &mgr->allocated_vres_list);
if (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS && adjust_dcc_size) {
diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
index 68ede7a725e2..e8c5c3601bf1 100644
--- a/drivers/gpu/drm/lima/lima_ctx.c
+++ b/drivers/gpu/drm/lima/lima_ctx.c
@@ -29,7 +29,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
goto err_out0;
ctx->pid = task_pid_nr(current);
- get_task_comm(ctx->pname, current);
+ strscpy_pad(ctx->pname, current->comm);
return 0;
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
index 3a7fce428898..11936c4d3573 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
@@ -36,7 +36,7 @@ static void panfrost_gem_debugfs_bo_add(struct panfrost_device *pfdev,
struct panfrost_gem_object *bo)
{
bo->debugfs.creator.tgid = current->tgid;
- get_task_comm(bo->debugfs.creator.process_name, current->group_leader);
+ strscpy_pad(bo->debugfs.creator.process_name, current->group_leader->comm);
mutex_lock(&pfdev->debugfs.gems_lock);
list_add_tail(&bo->debugfs.node, &pfdev->debugfs.gems_list);
diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
index b090b01211ad..8ffc6cef7100 100644
--- a/drivers/gpu/drm/panthor/panthor_gem.c
+++ b/drivers/gpu/drm/panthor/panthor_gem.c
@@ -54,7 +54,7 @@ static void panthor_gem_debugfs_bo_add(struct panthor_gem_object *bo)
struct panthor_device, base);
bo->debugfs.creator.tgid = current->tgid;
- get_task_comm(bo->debugfs.creator.process_name, current->group_leader);
+ strscpy_pad(bo->debugfs.creator.process_name, current->group_leader->comm);
mutex_lock(&ptdev->gems.lock);
list_add_tail(&bo->debugfs.node, &ptdev->gems.node);
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index 5778e23e20a0..1702b12ee395 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -3617,7 +3617,7 @@ static void group_init_task_info(struct panthor_group *group)
struct task_struct *task = current->group_leader;
group->task_info.pid = task->pid;
- get_task_comm(group->task_info.comm, task);
+ strscpy_pad(group->task_info.comm, task->comm);
}
static void add_group_kbo_sizes(struct panthor_device *ptdev,
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 3d8e4ccdb7c1..b10a0e1cb1ed 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -50,7 +50,7 @@ static void virtio_gpu_create_context_locked(struct virtio_gpu_device *vgdev,
} else {
char dbgname[TASK_COMM_LEN];
- get_task_comm(dbgname, current);
+ strscpy_pad(dbgname, current->comm);
virtio_gpu_cmd_context_create(vgdev, vfpriv->ctx_id,
vfpriv->context_init, strlen(dbgname),
dbgname);
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index f48c6a8a0654..c7715439964e 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -634,7 +634,7 @@ static ssize_t stm_char_write(struct file *file, const char __user *buf,
char comm[sizeof(current->comm)];
char *ids[] = { comm, "default", NULL };
- get_task_comm(comm, current);
+ strscpy_pad(comm, current->comm);
err = stm_assign_first_policy(stmf->stm, &stmf->output, ids, 1);
/*
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index d014af6ab060..d514a81d0a5c 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -77,7 +77,7 @@ static void tty_audit_log(const char *description, dev_t dev,
audit_log_format(ab, "%s pid=%u uid=%u auid=%u ses=%u major=%d minor=%d comm=",
description, pid, uid, loginuid, sessionid,
MAJOR(dev), MINOR(dev));
- get_task_comm(name, current);
+ strscpy_pad(name, current->comm);
audit_log_untrustedstring(ab, name);
audit_log_format(ab, " data=");
audit_log_n_hex(ab, data, size);
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 06d0df105382..a47d393a10b5 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1554,7 +1554,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
SET_UID(psinfo->pr_uid, from_kuid_munged(cred->user_ns, cred->uid));
SET_GID(psinfo->pr_gid, from_kgid_munged(cred->user_ns, cred->gid));
rcu_read_unlock();
- get_task_comm(psinfo->pr_fname, p);
+ strscpy_pad(psinfo->pr_fname, p->comm);
return 0;
}
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 068c46875c74..76333fa2f949 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1376,7 +1376,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
SET_UID(psinfo->pr_uid, from_kuid_munged(cred->user_ns, cred->uid));
SET_GID(psinfo->pr_gid, from_kgid_munged(cred->user_ns, cred->gid));
rcu_read_unlock();
- get_task_comm(psinfo->pr_fname, p);
+ strscpy_pad(psinfo->pr_fname, p->comm);
return 0;
}
diff --git a/fs/proc/array.c b/fs/proc/array.c
index f6f75d206762..8ebb7cf1a7b0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -110,7 +110,7 @@ void proc_task_name(struct seq_file *m, struct task_struct *p, bool escape)
else if (p->flags & PF_KTHREAD)
get_kthread_comm(tcomm, sizeof(tcomm), p);
else
- get_task_comm(tcomm, p);
+ strscpy_pad(tcomm, p->comm);
if (escape)
seq_escape_str(m, tcomm, ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c7cdbb3e4aa6..474ca86ec105 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2035,25 +2035,6 @@ extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec
__set_task_comm(tsk, from, false); \
})
-/*
- * - Why not use task_lock()?
- * User space can randomly change their names anyway, so locking for readers
- * doesn't make sense. For writers, locking is probably necessary, as a race
- * condition could lead to long-term mixed results.
- * The strscpy_pad() in __set_task_comm() can ensure that the task comm is
- * always NUL-terminated and zero-padded. Therefore the race condition between
- * reader and writer is not an issue.
- *
- * - BUILD_BUG_ON() can help prevent the buf from being truncated.
- * Since the callers don't perform any return value checks, this safeguard is
- * necessary.
- */
-#define get_task_comm(buf, tsk) ({ \
- BUILD_BUG_ON(sizeof(buf) < TASK_COMM_LEN); \
- strscpy_pad(buf, (tsk)->comm); \
- buf; \
-})
-
static __always_inline void scheduler_ipi(void)
{
/*
diff --git a/kernel/audit.c b/kernel/audit.c
index 9412af9144bc..75bcc0d43c55 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1667,7 +1667,8 @@ static void audit_log_multicast(int group, const char *op, int err)
audit_put_tty(tty);
audit_log_task_context(ab); /* subj= */
audit_log_format(ab, " comm=");
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
audit_log_d_path_exe(ab, current->mm); /* exe= */
audit_log_format(ab, " nl-mcgrp=%d op=%s res=%d", group, op, !err);
audit_log_end(ab);
@@ -2483,7 +2484,8 @@ void audit_log_task_info(struct audit_buffer *ab)
audit_get_sessionid(current));
audit_put_tty(tty);
audit_log_format(ab, " comm=");
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
audit_log_d_path_exe(ab, current->mm);
audit_log_task_context(ab);
}
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 2b9ce0b52511..79e2aae80685 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2878,7 +2878,8 @@ void __audit_log_nfcfg(const char *name, u8 af, unsigned int nentries,
audit_log_format(ab, " pid=%u", task_tgid_nr(current));
audit_log_task_context(ab); /* subj= */
audit_log_format(ab, " comm=");
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
audit_log_end(ab);
}
EXPORT_SYMBOL_GPL(__audit_log_nfcfg);
@@ -2901,7 +2902,8 @@ static void audit_log_task(struct audit_buffer *ab)
sessionid);
audit_log_task_context(ab);
audit_log_format(ab, " pid=%d comm=", task_tgid_nr(current));
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
audit_log_d_path_exe(ab, current->mm);
}
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 3fcdf4b4e2e5..bfe1de723d93 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2247,7 +2247,7 @@ static u16 printk_sprint(char *text, u16 size, int facility,
static void printk_store_execution_ctx(struct printk_info *info)
{
info->caller_id2 = printk_caller_id2();
- get_task_comm(info->comm, current);
+ strscpy_pad(info->comm, current->comm);
}
static void pmsg_load_execution_ctx(struct printk_message *pmsg,
diff --git a/kernel/sys.c b/kernel/sys.c
index 35b538ba843c..97df708c11a0 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2609,7 +2609,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
proc_comm_connector(me);
break;
case PR_GET_NAME:
- get_task_comm(comm, me);
+ strscpy_pad(comm, me->comm);
if (copy_to_user((char __user *)arg2, comm, sizeof(comm)))
return -EFAULT;
break;
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 070ca388f9ac..4e66cb2d9549 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -104,7 +104,7 @@ static bool hci_sock_gen_cookie(struct sock *sk)
id = 0xffffffff;
hci_pi(sk)->cookie = id;
- get_task_comm(hci_pi(sk)->comm, current);
+ strscpy_pad(hci_pi(sk)->comm, current->comm);
return true;
}
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index af357f6c5070..f5f65f86aecc 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -9723,9 +9723,11 @@ static int nf_tables_fill_gen_info(struct sk_buff *skb, struct net *net,
if (!nlh)
goto nla_put_failure;
+ strscpy_pad(buf, current->comm);
+
if (nla_put_be32(skb, NFTA_GEN_ID, htonl(nft_base_seq(net))) ||
nla_put_be32(skb, NFTA_GEN_PROC_PID, htonl(task_pid_nr(current))) ||
- nla_put_string(skb, NFTA_GEN_PROC_NAME, get_task_comm(buf, current)))
+ nla_put_string(skb, NFTA_GEN_PROC_NAME, buf))
goto nla_put_failure;
nlmsg_end(skb, nlh);
diff --git a/security/integrity/integrity_audit.c b/security/integrity/integrity_audit.c
index d8d9e5ff1cd2..98060060929d 100644
--- a/security/integrity/integrity_audit.c
+++ b/security/integrity/integrity_audit.c
@@ -54,7 +54,8 @@ void integrity_audit_message(int audit_msgno, struct inode *inode,
audit_get_sessionid(current));
audit_log_task_context(ab);
audit_log_format(ab, " op=%s cause=%s comm=", op, cause);
- audit_log_untrustedstring(ab, get_task_comm(name, current));
+ strscpy_pad(name, current->comm);
+ audit_log_untrustedstring(ab, name);
if (fname) {
audit_log_format(ab, " name=");
audit_log_untrustedstring(ab, fname);
diff --git a/security/ipe/audit.c b/security/ipe/audit.c
index 93fb59fbddd6..90a6acfb7cdf 100644
--- a/security/ipe/audit.c
+++ b/security/ipe/audit.c
@@ -145,7 +145,8 @@ void ipe_audit_match(const struct ipe_eval_ctx *const ctx,
audit_log_format(ab, "ipe_op=%s ipe_hook=%s enforcing=%d pid=%d comm=",
op, audit_hook_names[ctx->hook], READ_ONCE(enforce),
task_tgid_nr(current));
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
if (ctx->file) {
audit_log_d_path(ab, " path=", &ctx->file->f_path);
diff --git a/security/landlock/domain.c b/security/landlock/domain.c
index 93c7104fd6b2..dd997391df0e 100644
--- a/security/landlock/domain.c
+++ b/security/landlock/domain.c
@@ -562,7 +562,7 @@ static struct landlock_details *get_current_details(void)
memcpy(details->exe_path, path_str, path_size);
details->pid = get_pid(task_tgid(current));
details->uid = from_kuid(&init_user_ns, current_uid());
- get_task_comm(details->comm, current);
+ strscpy_pad(details->comm, current->comm);
return details;
}
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 737f5a263a8f..a587ffecd985 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -276,8 +276,8 @@ void audit_log_lsm_data(struct audit_buffer *ab,
if (pid) {
char tskcomm[sizeof(tsk->comm)];
audit_log_format(ab, " opid=%d ocomm=", pid);
- audit_log_untrustedstring(ab,
- get_task_comm(tskcomm, tsk));
+ strscpy_pad(tskcomm, tsk->comm);
+ audit_log_untrustedstring(ab, tskcomm);
}
}
break;
@@ -417,7 +417,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
char comm[sizeof(current->comm)];
audit_log_format(ab, " pid=%d comm=", task_tgid_nr(current));
- audit_log_untrustedstring(ab, get_task_comm(comm, current));
+ strscpy_pad(comm, current->comm);
+ audit_log_untrustedstring(ab, comm);
audit_log_lsm_data(ab, a);
}
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm()
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
2026-08-27 18:23 ` [PATCH v5 1/6] treewide: Get rid of get_task_comm() André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 18:35 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm() André Almeida
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
In order to increase the size of current->comm[] and to avoid breaking any
existing code, replace memcpy() with copy_task_comm(). This new function
makes sure that the copy is NUL terminated. This is crucial given that the
source buffer might be larger than the destination buffer and could
truncate the NUL character out of it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
Changes from v4:
- Remove copy_task_comm() calls for structs other than struct task_struct
- Add checks for len > TASK_COMM_LEN and len < 0
Changes from v3:
- Simplify copy_task_comm() to a memcpy + NUL char at the end of buffer
Changes from v2:
- Bring back custom function.
Changes from v1:
- New patch, dropped strtostr() from last version
---
include/linux/coredump.h | 2 +-
include/linux/sched.h | 15 +++++++++++++++
include/linux/tracepoint.h | 4 ++--
include/trace/events/block.h | 10 +++++-----
include/trace/events/coredump.h | 2 +-
include/trace/events/f2fs.h | 4 ++--
include/trace/events/oom.h | 2 +-
include/trace/events/osnoise.h | 2 +-
include/trace/events/sched.h | 10 +++++-----
include/trace/events/signal.h | 2 +-
include/trace/events/task.h | 4 ++--
11 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index 7b38ee2e7913..dee82e3c350a 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -58,7 +58,7 @@ extern void vfs_coredump(const kernel_siginfo_t *siginfo);
do { \
char comm[TASK_COMM_LEN]; \
/* This will always be NUL terminated. */ \
- memcpy(comm, current->comm, sizeof(comm)); \
+ copy_task_comm(comm, current, sizeof(comm)); \
printk_ratelimited(Level "coredump: %d(%*pE): " Format "\n", \
task_tgid_vnr(current), (int)strlen(comm), comm, ##__VA_ARGS__); \
} while (0) \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 474ca86ec105..8d2355e41619 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2035,6 +2035,21 @@ extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec
__set_task_comm(tsk, from, false); \
})
+/*
+ * Copy task name to a buffer. Final result is always a NUL-terminated string.
+ */
+static __always_inline void copy_task_comm(char *dst, struct task_struct *tsk, size_t len)
+{
+ const char *_src = tsk->comm;
+ size_t _len = min(len, TASK_COMM_LEN);
+
+ if (!_len)
+ return;
+
+ memcpy(dst, _src, _len);
+ dst[_len - 1] = '\0';
+}
+
static __always_inline void scheduler_ipi(void)
{
/*
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index e0d838c9ce93..9b0094fa44c6 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -637,10 +637,10 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
* *
*
* TP_fast_assign(
- * memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
+ * copy_task_comm(__entry->next_comm, next, TASK_COMM_LEN);
* __entry->prev_pid = prev->pid;
* __entry->prev_prio = prev->prio;
- * memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
+ * copy_task_comm(__entry->prev_comm, prev, TASK_COMM_LEN);
* __entry->next_pid = next->pid;
* __entry->next_prio = next->prio;
* ),
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 9c97a16850b9..1e3a9ded03bd 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -213,7 +213,7 @@ DECLARE_EVENT_CLASS(block_rq,
blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
__get_str(cmd)[0] = '\0';
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("%d,%d %s %u (%s) %llu + %u %s,%u,%u [%s]",
@@ -410,7 +410,7 @@ DECLARE_EVENT_CLASS(block_bio,
__entry->sector = bio->bi_iter.bi_sector;
__entry->nr_sector = bio_sectors(bio);
blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("%d,%d %s %llu + %u [%s]",
@@ -493,7 +493,7 @@ TRACE_EVENT(block_plug,
),
TP_fast_assign(
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("[%s]", __entry->comm)
@@ -512,7 +512,7 @@ DECLARE_EVENT_CLASS(block_unplug,
TP_fast_assign(
__entry->nr_rq = depth;
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
@@ -563,7 +563,7 @@ TRACE_EVENT(block_split,
__entry->sector = bio->bi_iter.bi_sector;
__entry->new_sector = new_sector;
blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("%d,%d %s %llu / %llu [%s]",
diff --git a/include/trace/events/coredump.h b/include/trace/events/coredump.h
index c7b9c53fc498..fdd20bc46bb0 100644
--- a/include/trace/events/coredump.h
+++ b/include/trace/events/coredump.h
@@ -32,7 +32,7 @@ TRACE_EVENT(coredump,
TP_fast_assign(
__entry->sig = sig;
- memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, current, TASK_COMM_LEN);
),
TP_printk("sig=%d comm=%s",
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 270c1a2c24c4..7d22650b4c78 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -2505,7 +2505,7 @@ TRACE_EVENT(f2fs_lock_elapsed_time,
TP_fast_assign(
__entry->dev = sbi->sb->s_dev;
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, p, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio;
__entry->ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
@@ -2558,7 +2558,7 @@ DECLARE_EVENT_CLASS(f2fs_priority_update,
TP_fast_assign(
__entry->dev = sbi->sb->s_dev;
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, p, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->lock_name = lock_name;
__entry->is_write = is_write;
diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h
index 9f0a5d1482c4..8bcdc4ffc8d3 100644
--- a/include/trace/events/oom.h
+++ b/include/trace/events/oom.h
@@ -23,7 +23,7 @@ TRACE_EVENT(oom_score_adj_update,
TP_fast_assign(
__entry->pid = task->pid;
- memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, task, TASK_COMM_LEN);
__entry->oom_score_adj = task->signal->oom_score_adj;
),
diff --git a/include/trace/events/osnoise.h b/include/trace/events/osnoise.h
index 3f4273623801..2cf047bb9fb7 100644
--- a/include/trace/events/osnoise.h
+++ b/include/trace/events/osnoise.h
@@ -116,7 +116,7 @@ TRACE_EVENT(thread_noise,
),
TP_fast_assign(
- memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, t, TASK_COMM_LEN);
__entry->pid = t->pid;
__entry->start = start;
__entry->duration = duration;
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 535860581f15..afb24e9dac91 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -152,7 +152,7 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
),
TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, p, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
__entry->target_cpu = task_cpu(p);
@@ -237,11 +237,11 @@ TRACE_EVENT(sched_switch,
),
TP_fast_assign(
- memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->prev_comm, prev, TASK_COMM_LEN);
__entry->prev_pid = prev->pid;
__entry->prev_prio = prev->prio;
__entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev);
- memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->next_comm, next, TASK_COMM_LEN);
__entry->next_pid = next->pid;
__entry->next_prio = next->prio;
/* XXX SCHED_DEADLINE */
@@ -346,7 +346,7 @@ TRACE_EVENT(sched_process_exit,
),
TP_fast_assign(
- memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, p, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->prio = p->prio; /* XXX SCHED_DEADLINE */
__entry->group_dead = group_dead;
@@ -787,7 +787,7 @@ TRACE_EVENT(sched_skip_cpuset_numa,
),
TP_fast_assign(
- memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, tsk, TASK_COMM_LEN);
__entry->pid = task_pid_nr(tsk);
__entry->tgid = task_tgid_nr(tsk);
__entry->ngid = task_numa_group_id(tsk);
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h
index 1db7e4b07c01..8fffe6d9bdcc 100644
--- a/include/trace/events/signal.h
+++ b/include/trace/events/signal.h
@@ -67,7 +67,7 @@ TRACE_EVENT(signal_generate,
TP_fast_assign(
__entry->sig = sig;
TP_STORE_SIGINFO(__entry, info);
- memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, task, TASK_COMM_LEN);
__entry->pid = task->pid;
__entry->group = group;
__entry->result = result;
diff --git a/include/trace/events/task.h b/include/trace/events/task.h
index b9a129eb54d9..e3faaeb997ef 100644
--- a/include/trace/events/task.h
+++ b/include/trace/events/task.h
@@ -21,7 +21,7 @@ TRACE_EVENT(task_newtask,
TP_fast_assign(
__entry->pid = task->pid;
- memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
+ copy_task_comm(__entry->comm, task, TASK_COMM_LEN);
__entry->clone_flags = clone_flags;
__entry->oom_score_adj = task->signal->oom_score_adj;
),
@@ -46,7 +46,7 @@ TRACE_EVENT(task_rename,
TP_fast_assign(
__entry->pid = task->pid;
- memcpy(entry->oldcomm, task->comm, TASK_COMM_LEN);
+ copy_task_comm(entry->oldcomm, task, TASK_COMM_LEN);
strscpy(entry->newcomm, comm, TASK_COMM_LEN);
__entry->oom_score_adj = task->signal->oom_score_adj;
),
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm()
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
2026-08-27 18:23 ` [PATCH v5 1/6] treewide: Get rid of get_task_comm() André Almeida
2026-08-27 18:23 ` [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm() André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 18:47 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN André Almeida
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
Add a new test for copy_task_comm(). Check if a copy from a task_struct
works, and special cases when the size of source and destination buffer
mismatches.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
lib/tests/string_kunit.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/lib/tests/string_kunit.c b/lib/tests/string_kunit.c
index 0819ace5b027..27a27ab13254 100644
--- a/lib/tests/string_kunit.c
+++ b/lib/tests/string_kunit.c
@@ -881,6 +881,43 @@ static void string_bench_strrchr(struct kunit *test)
STRING_BENCH_BUF(test, buf, len, strrchr, buf, '\0');
}
+#define TASK_NAME "task_name"
+#define TASK_NAME_LEN 9
+#define TASK_MAX_LEN TASK_COMM_LEN
+#define SMALLER_LEN (TASK_NAME_LEN - 3)
+#define BIGGER_LEN (TASK_MAX_LEN + 3)
+
+static void string_copy_task_comm(struct kunit *test)
+{
+ char str[TASK_MAX_LEN] = TASK_NAME, copy[TASK_MAX_LEN],
+ smaller_buf[SMALLER_LEN], bigger_buf[BIGGER_LEN];
+ static struct task_struct task, *tsk = &task;
+ int len1, len2, i;
+
+ /* set and get task name */
+ set_task_comm(tsk, str);
+ copy_task_comm(copy, tsk, TASK_COMM_LEN);
+
+ len1 = strlen(str);
+ len2 = strlen(copy);
+
+ KUNIT_ASSERT_EQ(test, len1, len2);
+ KUNIT_ASSERT_EQ(test, len2, TASK_NAME_LEN);
+ KUNIT_ASSERT_EQ(test, copy[len2], '\0');
+ KUNIT_ASSERT_TRUE(test, !strcmp(str, copy));
+
+ /* copy to a smaller dst buffer */
+ copy_task_comm(smaller_buf, tsk, sizeof(smaller_buf));
+ KUNIT_ASSERT_TRUE(test, !strncmp(str, smaller_buf, SMALLER_LEN - 1));
+ KUNIT_ASSERT_EQ(test, smaller_buf[SMALLER_LEN - 1], '\0');
+
+ /* copy to a bigger dst buffer */
+ copy_task_comm(bigger_buf, tsk, sizeof(bigger_buf));
+ KUNIT_ASSERT_TRUE(test, !strncmp(str, bigger_buf, TASK_NAME_LEN));
+ for (i = TASK_NAME_LEN; i < BIGGER_LEN; i++)
+ KUNIT_ASSERT_EQ(test, bigger_buf[i], '\0');
+}
+
static struct kunit_case string_test_cases[] = {
KUNIT_CASE(string_test_memset16),
KUNIT_CASE(string_test_memset32),
@@ -910,6 +947,7 @@ static struct kunit_case string_test_cases[] = {
KUNIT_CASE(string_bench_strnlen),
KUNIT_CASE(string_bench_strchr),
KUNIT_CASE(string_bench_strrchr),
+ KUNIT_CASE(string_copy_task_comm),
{}
};
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
` (2 preceding siblings ...)
2026-08-27 18:23 ` [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm() André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 19:05 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 5/6] prctl: Add support for long user thread names André Almeida
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
5 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
Command name has been restrict to only 16 bytes, which is too limiting,
specially when debugging and tracing complex software with thousands of
threads and the need to differentiate them.
Just as it was done with kthreads in commit 6b59808bfe48 ("workqueue:
Show the latest workqueue name in /proc/PID/{comm,stat,status}"), support
long names for userspace threads as well.
To avoid buffer overflows, cap all existing userspace APIs to
TASK_COMM_LEN, and leave the full extended name for a new interface.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
fs/proc/array.c | 2 +-
include/linux/sched.h | 5 +++--
kernel/sys.c | 10 +++++-----
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 8ebb7cf1a7b0..0d70b21c803c 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -110,7 +110,7 @@ void proc_task_name(struct seq_file *m, struct task_struct *p, bool escape)
else if (p->flags & PF_KTHREAD)
get_kthread_comm(tcomm, sizeof(tcomm), p);
else
- strscpy_pad(tcomm, p->comm);
+ strscpy_pad(tcomm, p->comm, TASK_COMM_LEN);
if (escape)
seq_escape_str(m, tcomm, ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8d2355e41619..c41d61e9babf 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -323,6 +323,7 @@ struct user_event_mm;
*/
enum {
TASK_COMM_LEN = 16,
+ TASK_COMM_EXT_LEN = 64,
};
extern void sched_tick(void);
@@ -1187,7 +1188,7 @@ struct task_struct {
* - set it with set_task_comm() to ensure it is always
* NUL-terminated and zero-padded
*/
- char comm[TASK_COMM_LEN];
+ char comm[TASK_COMM_EXT_LEN];
struct nameidata *nameidata;
@@ -2041,7 +2042,7 @@ extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec
static __always_inline void copy_task_comm(char *dst, struct task_struct *tsk, size_t len)
{
const char *_src = tsk->comm;
- size_t _len = min(len, TASK_COMM_LEN);
+ size_t _len = min(len, TASK_COMM_EXT_LEN);
if (!_len)
return;
diff --git a/kernel/sys.c b/kernel/sys.c
index 97df708c11a0..5ebd3c1dfddf 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2535,7 +2535,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
unsigned long, arg4, unsigned long, arg5)
{
struct task_struct *me = current;
- unsigned char comm[sizeof(me->comm)];
+ unsigned char comm[TASK_COMM_LEN];
long error;
error = security_task_prctl(option, arg2, arg3, arg4, arg5);
@@ -2601,16 +2601,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = -EINVAL;
break;
case PR_SET_NAME:
- comm[sizeof(me->comm) - 1] = 0;
+ comm[TASK_COMM_LEN - 1] = 0;
if (strncpy_from_user(comm, (char __user *)arg2,
- sizeof(me->comm) - 1) < 0)
+ TASK_COMM_LEN - 1) < 0)
return -EFAULT;
set_task_comm(me, comm);
proc_comm_connector(me);
break;
case PR_GET_NAME:
- strscpy_pad(comm, me->comm);
- if (copy_to_user((char __user *)arg2, comm, sizeof(comm)))
+ strscpy_pad(comm, me->comm, TASK_COMM_LEN);
+ if (copy_to_user((char __user *)arg2, comm, TASK_COMM_LEN))
return -EFAULT;
break;
case PR_GET_ENDIAN:
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v5 5/6] prctl: Add support for long user thread names
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
` (3 preceding siblings ...)
2026-08-27 18:23 ` [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 19:08 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
5 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
Add support for getting and setting long user thread names with
PR_{SET,GET}_EXT_NAME.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
include/linux/sched.h | 2 +-
include/uapi/linux/prctl.h | 3 +++
kernel/sys.c | 15 ++++++++++++++-
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c41d61e9babf..4f2cd802f172 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2032,7 +2032,7 @@ extern void kick_process(struct task_struct *tsk);
extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
#define set_task_comm(tsk, from) ({ \
- BUILD_BUG_ON(sizeof(from) != TASK_COMM_LEN); \
+ BUILD_BUG_ON(sizeof(from) < TASK_COMM_LEN); \
__set_task_comm(tsk, from, false); \
})
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h
index b6ec6f693719..a07f8edadd65 100644
--- a/include/uapi/linux/prctl.h
+++ b/include/uapi/linux/prctl.h
@@ -56,6 +56,9 @@
#define PR_SET_NAME 15 /* Set process name */
#define PR_GET_NAME 16 /* Get process name */
+#define PR_SET_EXT_NAME 17 /* Set extended process name */
+#define PR_GET_EXT_NAME 18 /* Get extended process name */
+
/* Get/set process endian */
#define PR_GET_ENDIAN 19
#define PR_SET_ENDIAN 20
diff --git a/kernel/sys.c b/kernel/sys.c
index 5ebd3c1dfddf..4caf6ef836f1 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2535,7 +2535,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
unsigned long, arg4, unsigned long, arg5)
{
struct task_struct *me = current;
- unsigned char comm[TASK_COMM_LEN];
+ unsigned char comm[TASK_COMM_EXT_LEN];
long error;
error = security_task_prctl(option, arg2, arg3, arg4, arg5);
@@ -2613,6 +2613,19 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
if (copy_to_user((char __user *)arg2, comm, TASK_COMM_LEN))
return -EFAULT;
break;
+ case PR_SET_EXT_NAME:
+ comm[TASK_COMM_EXT_LEN - 1] = 0;
+ if (strncpy_from_user(comm, (char __user *)arg2,
+ TASK_COMM_EXT_LEN - 1) < 0)
+ return -EFAULT;
+ set_task_comm(me, comm);
+ proc_comm_connector(me);
+ break;
+ case PR_GET_EXT_NAME:
+ strscpy_pad(comm, me->comm, TASK_COMM_EXT_LEN);
+ if (copy_to_user((char __user *)arg2, comm, TASK_COMM_EXT_LEN))
+ return -EFAULT;
+ break;
case PR_GET_ENDIAN:
error = GET_ENDIAN(me, arg2);
break;
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v5 6/6] selftests: prctl: Add test for long thread names
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
` (4 preceding siblings ...)
2026-08-27 18:23 ` [PATCH v5 5/6] prctl: Add support for long user thread names André Almeida
@ 2026-08-27 18:23 ` André Almeida
2026-08-27 19:14 ` sashiko-bot
` (2 more replies)
5 siblings, 3 replies; 15+ messages in thread
From: André Almeida @ 2026-08-27 18:23 UTC (permalink / raw)
To: Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: linux-kernel, kernel-dev, linux-mm, linux-api, linux-trace-kernel,
André Almeida
Add tests for the new interface to set and get long thread names. The
kernel should accept the LONG_NAME and returning it accordingly. For the
old PR_GET_NAME interface, the kernel should truncate the name up to 16
chars. /proc/<task>/comm should return the same string ad PR_GET_NAME.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
tools/testing/selftests/prctl/set-process-name.c | 37 ++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tools/testing/selftests/prctl/set-process-name.c b/tools/testing/selftests/prctl/set-process-name.c
index 3f7b146d36df..951319d60656 100644
--- a/tools/testing/selftests/prctl/set-process-name.c
+++ b/tools/testing/selftests/prctl/set-process-name.c
@@ -9,9 +9,17 @@
#include "kselftest_harness.h"
+#ifndef PR_SET_EXT_NAME
+# define PR_SET_EXT_NAME 17
+# define PR_GET_EXT_NAME 18
+#endif
+
#define CHANGE_NAME "changename"
+#define LONG_NAME "change_to_very_long_extended_name"
+#define LONG_NAME_CAP "change_to_very_"
#define EMPTY_NAME ""
#define TASK_COMM_LEN 16
+#define TASK_COMM_EXT_LEN 64
#define MAX_PATH_LEN 50
int set_name(char *name)
@@ -25,6 +33,17 @@ int set_name(char *name)
return res;
}
+int set_ext_name(char *name)
+{
+ int res;
+
+ res = prctl(PR_SET_EXT_NAME, name, NULL, NULL, NULL);
+
+ if (res < 0)
+ return -errno;
+ return res;
+}
+
int check_is_name_correct(char *check_name)
{
char name[TASK_COMM_LEN];
@@ -38,6 +57,19 @@ int check_is_name_correct(char *check_name)
return !strcmp(name, check_name);
}
+int check_is_ext_name_correct(char *check_name)
+{
+ char name[TASK_COMM_EXT_LEN];
+ int res;
+
+ res = prctl(PR_GET_EXT_NAME, name, NULL, NULL, NULL);
+
+ if (res < 0)
+ return -errno;
+
+ return !strcmp(name, check_name);
+}
+
int check_null_pointer(char *check_name)
{
char *name = NULL;
@@ -82,6 +114,11 @@ TEST(rename_process) {
EXPECT_GE(set_name(CHANGE_NAME), 0);
EXPECT_TRUE(check_is_name_correct(CHANGE_NAME));
+ EXPECT_GE(set_ext_name(LONG_NAME), 0);
+ EXPECT_TRUE(check_is_ext_name_correct(LONG_NAME));
+ EXPECT_TRUE(check_is_name_correct(LONG_NAME_CAP));
+ EXPECT_TRUE(check_name());
+
EXPECT_GE(set_name(EMPTY_NAME), 0);
EXPECT_TRUE(check_is_name_correct(EMPTY_NAME));
--
2.55.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm()
2026-08-27 18:23 ` [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm() André Almeida
@ 2026-08-27 18:35 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 18:35 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The treewide replacement of memcpy() with copy_task_comm() missed a tracepoint in the BPF test module.
--
commit 0b4391937405bf7ef33f5ddc8cc5b7e81c93d587
Author: André Almeida <andrealmeid@igalia.com>
treewide: Replace memcpy(..., current->comm) with copy_task_comm()
This patch replaces treewide instances of memcpy() copying task->comm with a
new copy_task_comm() function. This ensures the destination buffer is always
NUL-terminated, preparing for future extensions of the task command name
length.
[ ... ]
> diff --git a/include/trace/events/task.h b/include/trace/events/task.h
> index b9a129eb54d9e..e3faaeb997ef2 100644
> --- a/include/trace/events/task.h
> +++ b/include/trace/events/task.h
> @@ -21,7 +21,7 @@ TRACE_EVENT(task_newtask,
>
> TP_fast_assign(
> __entry->pid = task->pid;
> - memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
> + copy_task_comm(__entry->comm, task, TASK_COMM_LEN);
> __entry->clone_flags = clone_flags;
> __entry->oom_score_adj = task->signal->oom_score_adj;
> ),
[Severity: Medium]
Did this treewide replacement miss a tracepoint in the BPF test module?
Looking at TRACE_EVENT(bpf_testmod_test_read) in
tools/testing/selftests/bpf/test_kmods/bpf_testmod-events.h, it still uses
memcpy() instead of copy_task_comm():
memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
If a task sets its name to 16 or more characters (which becomes possible
with the extension to 64 bytes in later patches) and the
bpf_testmod_test_read tracepoint is hit, the 16-byte __entry->comm buffer
will not be NUL-terminated.
Can this cause an out-of-bounds read when tracing consumers or TP_printk()
read the non-NUL-terminated comm buffer?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 1/6] treewide: Get rid of get_task_comm()
2026-08-27 18:23 ` [PATCH v5 1/6] treewide: Get rid of get_task_comm() André Almeida
@ 2026-08-27 18:40 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 18:40 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit removes the `get_task_comm()` macro definition from `include/linux/sched.h`, but fails to update its usages in the Smack security module. This will result in an implicit function declaration or undeclared identifier error during compilation, breaking the build when `CONFIG_SECURITY_SMACK` is enabled.
--
commit 2f9c1f9e715d0c7c819d963ab3e8781e9ac3ae49
Author: André Almeida <andrealmeid@igalia.com>
treewide: Get rid of get_task_comm()
This commit replaces usages of get_task_comm() with strscpy_pad() across
the tree to correctly handle buffer size mismatches. It also removes the
definition of the get_task_comm() macro entirely from include/linux/sched.h.
Link: https://lore.kernel.org/lkml/CAHk-=wi5c=_-FBGo_88CowJd_F-Gi6Ud9d=TALm65ReN7YjrMw@mail.gmail.com/
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index c7cdbb3e4aa68..474ca86ec105e 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
[ ... ]
> @@ -2035,25 +2035,6 @@ extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec
> __set_task_comm(tsk, from, false); \
> })
>
> -/*
> - * - Why not use task_lock()?
> - * User space can randomly change their names anyway, so locking for readers
> - * doesn't make sense. For writers, locking is probably necessary, as a race
> - * condition could lead to long-term mixed results.
> - * The strscpy_pad() in __set_task_comm() can ensure that the task comm is
> - * always NUL-terminated and zero-padded. Therefore the race condition between
> - * reader and writer is not an issue.
> - *
> - * - BUILD_BUG_ON() can help prevent the buf from being truncated.
> - * Since the callers don't perform any return value checks, this safeguard is
> - * necessary.
> - */
> -#define get_task_comm(buf, tsk) ({ \
> - BUILD_BUG_ON(sizeof(buf) < TASK_COMM_LEN); \
> - strscpy_pad(buf, (tsk)->comm); \
> - buf; \
> -})
> -
[Severity: Low]
Does this removal cause a build failure when CONFIG_SECURITY_SMACK is enabled?
There appear to be remaining callers of get_task_comm() in the Smack security
module that were missed in this treewide replacement.
For example, in security/smack/smack_access.c:smack_log_callback():
get_task_comm(comm, sad->subj_tsk)
And in security/smack/smack_lsm.c:smk_bu_tsk_to_obj():
acc, get_task_comm(comm, tsk), note);
Without the macro definition in sched.h, will this result in implicit
function declaration or undeclared identifier errors during compilation?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm()
2026-08-27 18:23 ` [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm() André Almeida
@ 2026-08-27 18:47 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 18:47 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Calling `set_task_comm()` with a zero-initialized dummy `task_struct` will cause a kernel panic if tracepoints or perf events are enabled, due to a NULL pointer dereference on `task->signal`.
- [Low] The test uses an unexported kernel symbol (`__set_task_comm`), which will cause a linker failure when the KUnit test is compiled as a module.
--
commit 6dcb08d5f95331fc252e0238ecf8e3db7d303fb5
Author: André Almeida <andrealmeid@igalia.com>
lib/string_kunit: Add test for copy_task_comm()
This commit adds a new KUnit test for copy_task_comm() to verify copying from
a task_struct works correctly. It tests the standard case as well as special
cases where the source and destination buffer sizes mismatch.
> diff --git a/lib/tests/string_kunit.c b/lib/tests/string_kunit.c
> index 0819ace5b0275..27a27ab13254a 100644
> --- a/lib/tests/string_kunit.c
> +++ b/lib/tests/string_kunit.c
[ ... ]
> @@ -881,6 +881,43 @@ static void string_bench_strrchr(struct kunit *test)
> STRING_BENCH_BUF(test, buf, len, strrchr, buf, '\0');
> }
>
> +#define TASK_NAME "task_name"
> +#define TASK_NAME_LEN 9
> +#define TASK_MAX_LEN TASK_COMM_LEN
> +#define SMALLER_LEN (TASK_NAME_LEN - 3)
> +#define BIGGER_LEN (TASK_MAX_LEN + 3)
> +
> +static void string_copy_task_comm(struct kunit *test)
> +{
> + char str[TASK_MAX_LEN] = TASK_NAME, copy[TASK_MAX_LEN],
> + smaller_buf[SMALLER_LEN], bigger_buf[BIGGER_LEN];
> + static struct task_struct task, *tsk = &task;
> + int len1, len2, i;
> +
> + /* set and get task name */
> + set_task_comm(tsk, str);
[Severity: High]
Will this cause a kernel panic if tracepoints or perf events are enabled
during the test?
The test uses a zero-initialized static task_struct. The set_task_comm()
macro invokes __set_task_comm(), which eventually calls trace_task_rename()
and perf_event_comm().
If the task_rename tracepoint is enabled, the tracepoint macro dereferences
tsk->signal->oom_score_adj. Similarly, if COMM perf events are active,
perf_event_comm() calls perf_event_pid() which dereferences
tsk->signal->pids[PIDTYPE_TGID].
Since the dummy task's signal pointer is NULL, won't either path crash
the kernel with a NULL pointer dereference?
[Severity: Low]
Does this introduce a build failure when the test is compiled as a module?
CONFIG_STRING_KUNIT_TEST can be built as a module. The set_task_comm() macro
calls __set_task_comm(), which is defined in fs/exec.c but does not appear
to be exported via EXPORT_SYMBOL.
Will this result in a linker failure at the modpost stage for module builds?
> + copy_task_comm(copy, tsk, TASK_COMM_LEN);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=3
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN
2026-08-27 18:23 ` [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN André Almeida
@ 2026-08-27 19:05 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 19:05 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Critical] blktrace binary API breakage due to increased payload size for BLK_TN_PROCESS events.
- [Medium] Audit logs expose the full 64-byte extended task name, violating the commit message's claim to cap all existing userspace APIs to 16 bytes.
- [Medium] The tracepoint `bpf_testmod_test_read` copies the task name without guaranteeing NUL termination, leading to an out-of-bounds read when printing.
- [Low] The patch series removed the `get_task_comm` macro but failed to update its callers in the Smack LSM, resulting in an implicit function declaration and a compilation error.
--
Hi,
I have some questions about this patch.
commit 4fa4b0c6a1f339946bd26a6d2c55d7f5cfb4c1f3
Author: André Almeida <andrealmeid@igalia.com>
Subject: sched: Extend task command name with TASK_COMM_EXT_LEN
The commit increases the task command name from 16 to 64 bytes. It aims to
support long names for userspace threads while capping existing userspace APIs
to TASK_COMM_LEN to avoid buffer overflows.
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index c7cdbb3e4aa68..c41d61e9babf9 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
[ ... ]
> @@ -1187,7 +1188,7 @@ struct task_struct {
> * - set it with set_task_comm() to ensure it is always
> * NUL-terminated and zero-padded
> */
> - char comm[TASK_COMM_LEN];
> + char comm[TASK_COMM_EXT_LEN];
>
> struct nameidata *nameidata;
[Severity: Critical]
With the struct task_struct comm field expanding to 64 bytes, does this break
the blktrace binary ABI?
In kernel/trace/blktrace.c:trace_note_tsk():
trace_note(bt, tsk->pid, BLK_TN_PROCESS, tsk->comm,
sizeof(tsk->comm), 0);
This will now write 64 bytes to the UAPI trace buffer instead of 16 bytes,
which can cause parsing errors or buffer overflows in userspace tools like
blkparse.
[Severity: Medium]
Will out-of-bounds reads happen in existing tracepoints that copy directly
from task->comm using TASK_COMM_LEN?
For example, in tools/testing/selftests/bpf/test_kmods/bpf_testmod-events.h:
memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
If a task name is 16 bytes or longer, there won't be a NUL terminator in
the first 16 bytes, which might cause TP_printk("%s") to read past the 16
bytes into adjacent trace event fields.
[ ... ]
> -#define get_task_comm(buf, tsk) ({ \
> - BUILD_BUG_ON(sizeof(buf) < TASK_COMM_LEN); \
> - strscpy_pad(buf, (tsk)->comm); \
> - buf; \
> -})
[Severity: Low]
Does removing get_task_comm() break the build if CONFIG_SECURITY_SMACK=y?
Callers in security/smack/smack_access.c:smack_log() and
security/smack/smack_lsm.c:smk_bu_current() still seem to use this macro.
> diff --git a/kernel/audit.c b/kernel/audit.c
> index 9412af9144bc9..75bcc0d43c558 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -1667,7 +1667,8 @@ static void audit_log_multicast(int group, const char *op, int err)
> audit_put_tty(tty);
> audit_log_task_context(ab); /* subj= */
> audit_log_format(ab, " comm=");
> - audit_log_untrustedstring(ab, get_task_comm(comm, current));
> + strscpy_pad(comm, current->comm);
> + audit_log_untrustedstring(ab, comm);
[Severity: Medium]
Since comm is declared as char comm[sizeof(current->comm)] at the top of
this function, and current->comm is now 64 bytes, does this expose the full
64-byte task name in the audit log?
The commit message mentions capping all existing userspace APIs to
TASK_COMM_LEN.
This same pattern appears in kernel/audit.c:audit_log_task_info(),
kernel/auditsc.c:audit_log_task(), and
security/lsm_audit.c:dump_common_audit_data().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=4
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 5/6] prctl: Add support for long user thread names
2026-08-27 18:23 ` [PATCH v5 5/6] prctl: Add support for long user thread names André Almeida
@ 2026-08-27 19:08 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 19:08 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Expanding the task comm buffer size without updating the caller size check allows out-of-bounds reads from 16-byte source buffers.
- [Medium] PR_GET_EXT_NAME writes a fixed 64 bytes to a user-provided pointer without taking a buffer length parameter, risking userspace buffer overflows.
- [Low] Calls to `get_task_comm()` were not updated in the smack security module, causing a build failure.
--
commit 14b42cecc71f504b5e0c3127a6bba6b0901cce09
Author: André Almeida <andrealmeid@igalia.com>
prctl: Add support for long user thread names
This commit adds support for getting and setting long user thread names
using the new PR_SET_EXT_NAME and PR_GET_EXT_NAME prctl options.
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index c41d61e9babf9..4f2cd802f1721 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -2032,7 +2032,7 @@ extern void kick_process(struct task_struct *tsk);
>
> extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec);
> #define set_task_comm(tsk, from) ({ \
> - BUILD_BUG_ON(sizeof(from) != TASK_COMM_LEN); \
> + BUILD_BUG_ON(sizeof(from) < TASK_COMM_LEN); \
> __set_task_comm(tsk, from, false); \
> })
[Severity: High]
Does this change allow out-of-bounds reads from 16-byte source buffers?
The macro validates that the buffer is at least TASK_COMM_LEN (16 bytes),
but the internal implementation __set_task_comm() uses the enlarged
destination struct size for bounding:
fs/exec.c:__set_task_comm() {
...
size_t len = strnlen(buf, sizeof(tsk->comm) - 1);
trace_task_rename(tsk, buf);
memcpy(tsk->comm, buf, len);
...
}
If a caller passes a 16-byte array without a NUL terminator, will
strnlen() read past the end of the buffer up to 63 bytes, copying
out-of-bounds stack or heap memory into tsk->comm?
[ ... ]
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 5ebd3c1dfddf7..4caf6ef836f1a 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
[ ... ]
> @@ -2613,6 +2613,19 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
> if (copy_to_user((char __user *)arg2, comm, TASK_COMM_LEN))
> return -EFAULT;
> break;
> + case PR_SET_EXT_NAME:
> + comm[TASK_COMM_EXT_LEN - 1] = 0;
> + if (strncpy_from_user(comm, (char __user *)arg2,
> + TASK_COMM_EXT_LEN - 1) < 0)
> + return -EFAULT;
> + set_task_comm(me, comm);
> + proc_comm_connector(me);
> + break;
> + case PR_GET_EXT_NAME:
> + strscpy_pad(comm, me->comm, TASK_COMM_EXT_LEN);
> + if (copy_to_user((char __user *)arg2, comm, TASK_COMM_EXT_LEN))
> + return -EFAULT;
> + break;
[Severity: Medium]
Could this lead to userspace buffer overflows?
This option writes a fixed 64 bytes to a user-provided pointer without
taking a buffer length parameter. If a userspace application calls
prctl(PR_GET_EXT_NAME, buf) with a buffer smaller than 64 bytes (e.g.,
assuming it behaves like PR_GET_NAME which uses 16 bytes), will this
blindly overwrite userspace memory and cause silent corruption?
[ ... ]
[Severity: Low]
Is the build broken for CONFIG_SECURITY_SMACK=y?
Calls to get_task_comm() do not seem to have been updated in the smack
security module after the macro was removed in a previous patch in this
series.
security/smack/smack_access.c:smack_log() {
...
audit_log_untrustedstring(ab,
get_task_comm(comm, sad->subj_tsk));
...
}
security/smack/smack_lsm.c:smk_bu_tsk_to_obj() {
...
pr_info("Smack %s: (%s %s %s) %s %s\n", smk_bu_mess[rc],
smk_of_task(tsp)->smk_known, oskp->smk_known,
acc, get_task_comm(comm, tsk), note);
...
}
Will these dangling usages cause compile-time failures?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=5
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 6/6] selftests: prctl: Add test for long thread names
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
@ 2026-08-27 19:14 ` sashiko-bot
2026-08-30 21:24 ` kernel test robot
2026-08-30 22:55 ` kernel test robot
2 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-08-27 19:14 UTC (permalink / raw)
To: André Almeida; +Cc: linux-trace-kernel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Stack buffer overflow in selftest when reading long thread names.
- [Medium] Helper functions return negative error codes on prctl failures, but the test framework incorrectly evaluates these as success.
--
commit fe809367165b80380a7910f0d6bf3371b37e1de5
Author: André Almeida <andrealmeid@igalia.com>
selftests: prctl: Add test for long thread names
Add tests for the new interface to set and get long thread names. The
kernel should accept the LONG_NAME and returning it accordingly. For the
old PR_GET_NAME interface, the kernel should truncate the name up to 16
chars. /proc/<task>/comm should return the same string ad PR_GET_NAME.
> diff --git a/tools/testing/selftests/prctl/set-process-name.c b/tools/testing/selftests/prctl/set-process-name.c
> index 3f7b146d36dfe..951319d606561 100644
> --- a/tools/testing/selftests/prctl/set-process-name.c
> +++ b/tools/testing/selftests/prctl/set-process-name.c
[ ... ]
> @@ -82,6 +114,11 @@ TEST(rename_process) {
> EXPECT_GE(set_name(CHANGE_NAME), 0);
> EXPECT_TRUE(check_is_name_correct(CHANGE_NAME));
>
> + EXPECT_GE(set_ext_name(LONG_NAME), 0);
> + EXPECT_TRUE(check_is_ext_name_correct(LONG_NAME));
[Severity: Medium]
If prctl() fails in check_is_ext_name_correct(), it returns a negative error
code. Since EXPECT_TRUE() evaluates any non-zero value as true, won't this
cause the test to incorrectly pass on failure?
Should the helper function return 0 on failure, or should the test use
EXPECT_EQ(1, check_is_ext_name_correct(LONG_NAME)) instead?
> + EXPECT_TRUE(check_is_name_correct(LONG_NAME_CAP));
> + EXPECT_TRUE(check_name());
[Severity: Medium]
When this test runs, it calls check_name() while the thread name is set to a
33-character string.
If the kernel incorrectly fails to truncate the long process name when reading
/proc/self/task/.../comm, could this cause a stack buffer overflow?
tools/testing/selftests/prctl/set-process-name.c:check_name() {
char output[TASK_COMM_LEN] = {};
...
fscanf(fptr, "%s", output);
...
}
Since fscanf with "%s" is unbounded, a long name surfaced by the kernel will
overflow the 16-byte output buffer and crash the test. Should we add a width
limit like "%15s" to the fscanf call to prevent this?
> +
> EXPECT_GE(set_name(EMPTY_NAME), 0);
> EXPECT_TRUE(check_is_name_correct(EMPTY_NAME));
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-tonyk-long_name-v5-0-5fa843782a00@igalia.com?part=6
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 6/6] selftests: prctl: Add test for long thread names
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
2026-08-27 19:14 ` sashiko-bot
@ 2026-08-30 21:24 ` kernel test robot
2026-08-30 22:55 ` kernel test robot
2 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2026-08-30 21:24 UTC (permalink / raw)
To: André Almeida, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Steven Rostedt, Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: oe-kbuild-all, LKML, kernel-dev, linux-mm, linux-api,
linux-trace-kernel, André Almeida
Hi André,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 73e3f0710014fe6d4ed98cfc02292f6121db7558]
url: https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/treewide-Get-rid-of-get_task_comm/20260827-152300
base: 73e3f0710014fe6d4ed98cfc02292f6121db7558
patch link: https://lore.kernel.org/r/20260827-tonyk-long_name-v5-6-5fa843782a00%40igalia.com
patch subject: [PATCH v5 6/6] selftests: prctl: Add test for long thread names
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20260830/202608302318.ORNqwjNf-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260830/202608302318.ORNqwjNf-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608302318.ORNqwjNf-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/asm-generic/bug.h:31,
from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/slab.h:15,
from include/linux/xattr.h:15,
from security/smack/smack_lsm.c:18:
security/smack/smack_lsm.c: In function 'smk_bu_tsk_to_obj':
security/smack/smack_lsm.c:150:22: error: implicit declaration of function 'get_task_comm'; did you mean 'set_task_comm'? [-Wimplicit-function-declaration]
150 | acc, get_task_comm(comm, tsk), note);
| ^~~~~~~~~~~~~
include/linux/printk.h:483:33: note: in definition of macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/printk.h:584:9: note: in expansion of macro 'printk'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
security/smack/smack_lsm.c:148:9: note: in expansion of macro 'pr_info'
148 | pr_info("Smack %s: (%s %s %s) %s %s\n", smk_bu_mess[rc],
| ^~~~~~~
>> include/linux/kern_levels.h:5:25: warning: format '%s' expects argument of type 'char *', but argument 6 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:483:25: note: in definition of macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:584:9: note: in expansion of macro 'printk'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:14:25: note: in expansion of macro 'KERN_SOH'
14 | #define KERN_INFO KERN_SOH "6" /* informational */
| ^~~~~~~~
include/linux/printk.h:584:16: note: in expansion of macro 'KERN_INFO'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~
security/smack/smack_lsm.c:148:9: note: in expansion of macro 'pr_info'
148 | pr_info("Smack %s: (%s %s %s) %s %s\n", smk_bu_mess[rc],
| ^~~~~~~
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v5 6/6] selftests: prctl: Add test for long thread names
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
2026-08-27 19:14 ` sashiko-bot
2026-08-30 21:24 ` kernel test robot
@ 2026-08-30 22:55 ` kernel test robot
2 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2026-08-30 22:55 UTC (permalink / raw)
To: André Almeida, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Steven Rostedt, Christian Brauner, Kees Cook, Shuah Khan, willy,
mathieu.desnoyers, David Laight, Linus Torvalds, akpm,
Yafang Shao, andrii.nakryiko, arnaldo.melo, Petr Mladek
Cc: oe-kbuild-all, LKML, kernel-dev, linux-mm, linux-api,
linux-trace-kernel, André Almeida
Hi André,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 73e3f0710014fe6d4ed98cfc02292f6121db7558]
url: https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/treewide-Get-rid-of-get_task_comm/20260827-152300
base: 73e3f0710014fe6d4ed98cfc02292f6121db7558
patch link: https://lore.kernel.org/r/20260827-tonyk-long_name-v5-6-5fa843782a00%40igalia.com
patch subject: [PATCH v5 6/6] selftests: prctl: Add test for long thread names
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20260831/202608310045.6IJtlqhj-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260831/202608310045.6IJtlqhj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608310045.6IJtlqhj-lkp@intel.com/
All warnings (new ones prefixed by >>):
security/smack/smack_lsm.c:150:8: error: call to undeclared function 'get_task_comm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
150 | acc, get_task_comm(comm, tsk), note);
| ^
security/smack/smack_lsm.c:150:8: note: did you mean 'get_task_mm'?
include/linux/sched/mm.h:151:26: note: 'get_task_mm' declared here
151 | extern struct mm_struct *get_task_mm(struct task_struct *task);
| ^
>> security/smack/smack_lsm.c:150:8: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
148 | pr_info("Smack %s: (%s %s %s) %s %s\n", smk_bu_mess[rc],
| ~~
| %d
149 | smk_of_task(tsp)->smk_known, oskp->smk_known,
150 | acc, get_task_comm(comm, tsk), note);
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:584:34: note: expanded from macro 'pr_info'
584 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:511:60: note: expanded from macro 'printk'
511 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:483:19: note: expanded from macro 'printk_index_wrap'
483 | _p_func(_fmt, ##__VA_ARGS__); \
| ~~~~ ^~~~~~~~~~~
1 warning and 1 error generated.
vim +150 security/smack/smack_lsm.c
d166c8024d620d Casey Schaufler 2014-08-27 132
fba3d32825f4bb Konstantin Andreev 2026-05-11 133 static int
fba3d32825f4bb Konstantin Andreev 2026-05-11 134 smk_bu_tsk_to_obj(struct task_struct *tsk, const struct task_smack *tsp,
fba3d32825f4bb Konstantin Andreev 2026-05-11 135 char *note, struct smack_known *oskp, int mode, int rc)
d166c8024d620d Casey Schaufler 2014-08-27 136 {
fba3d32825f4bb Konstantin Andreev 2026-05-11 137 #ifdef CONFIG_SECURITY_SMACK_BRINGUP
d166c8024d620d Casey Schaufler 2014-08-27 138 char acc[SMK_NUM_ACCESS_TYPE + 1];
fba3d32825f4bb Konstantin Andreev 2026-05-11 139 char comm[TASK_COMM_LEN];
d166c8024d620d Casey Schaufler 2014-08-27 140
d166c8024d620d Casey Schaufler 2014-08-27 141 if (rc <= 0)
d166c8024d620d Casey Schaufler 2014-08-27 142 return rc;
bf4b2fee997997 Casey Schaufler 2015-03-21 143 if (rc > SMACK_UNCONFINED_OBJECT)
bf4b2fee997997 Casey Schaufler 2015-03-21 144 rc = 0;
d166c8024d620d Casey Schaufler 2014-08-27 145
d166c8024d620d Casey Schaufler 2014-08-27 146 smk_bu_mode(mode, acc);
fba3d32825f4bb Konstantin Andreev 2026-05-11 147
bf4b2fee997997 Casey Schaufler 2015-03-21 148 pr_info("Smack %s: (%s %s %s) %s %s\n", smk_bu_mess[rc],
fba3d32825f4bb Konstantin Andreev 2026-05-11 149 smk_of_task(tsp)->smk_known, oskp->smk_known,
fba3d32825f4bb Konstantin Andreev 2026-05-11 @150 acc, get_task_comm(comm, tsk), note);
d166c8024d620d Casey Schaufler 2014-08-27 151 return 0;
d166c8024d620d Casey Schaufler 2014-08-27 152 #else
fba3d32825f4bb Konstantin Andreev 2026-05-11 153 return rc;
d166c8024d620d Casey Schaufler 2014-08-27 154 #endif
fba3d32825f4bb Konstantin Andreev 2026-05-11 155 }
fba3d32825f4bb Konstantin Andreev 2026-05-11 156
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-08-30 22:56 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 18:22 [PATCH v5 0/6] sched: Add support for long task name André Almeida
2026-08-27 18:23 ` [PATCH v5 1/6] treewide: Get rid of get_task_comm() André Almeida
2026-08-27 18:40 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 2/6] treewide: Replace memcpy(..., current->comm) with copy_task_comm() André Almeida
2026-08-27 18:35 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 3/6] lib/string_kunit: Add test for copy_task_comm() André Almeida
2026-08-27 18:47 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 4/6] sched: Extend task command name with TASK_COMM_EXT_LEN André Almeida
2026-08-27 19:05 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 5/6] prctl: Add support for long user thread names André Almeida
2026-08-27 19:08 ` sashiko-bot
2026-08-27 18:23 ` [PATCH v5 6/6] selftests: prctl: Add test for long " André Almeida
2026-08-27 19:14 ` sashiko-bot
2026-08-30 21:24 ` kernel test robot
2026-08-30 22:55 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox