aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/code-patching.c
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2024-11-21 15:07:05 +0000
committerKees Cook <[email protected]>2024-12-17 00:54:00 +0000
commit543841d1806029889c2f69f040e88b247aba8e22 (patch)
tree884ec17ff7ca5896763830ecfb056920e3ec0df7 /arch/powerpc/lib/code-patching.c
parentexec: Make sure task->comm is always NUL-terminated (diff)
downloadkernel-543841d1806029889c2f69f040e88b247aba8e22.tar.gz
kernel-543841d1806029889c2f69f040e88b247aba8e22.zip
exec: fix up /proc/pid/comm in the execveat(AT_EMPTY_PATH) case
Zbigniew mentioned at Linux Plumber's that systemd is interested in switching to execveat() for service execution, but can't, because the contents of /proc/pid/comm are the file descriptor which was used, instead of the path to the binary[1]. This makes the output of tools like top and ps useless, especially in a world where most fds are opened CLOEXEC so the number is truly meaningless. When the filename passed in is empty (e.g. with AT_EMPTY_PATH), use the dentry's filename for "comm" instead of using the useless numeral from the synthetic fdpath construction. This way the actual exec machinery is unchanged, but cosmetically the comm looks reasonable to admins investigating things. Instead of adding TASK_COMM_LEN more bytes to bprm, use one of the unused flag bits to indicate that we need to set "comm" from the dentry. Suggested-by: Zbigniew JÄ™drzejewski-Szmek <[email protected]> Suggested-by: Tycho Andersen <[email protected]> Suggested-by: Al Viro <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Link: https://github.com/uapi-group/kernel-features#set-comm-field-before-exec [1] Reviewed-by: Aleksa Sarai <[email protected]> Tested-by: Zbigniew JÄ™drzejewski-Szmek <[email protected]> Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
0 files changed, 0 insertions, 0 deletions