Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'execve-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull execve updates from Kees Cook:

- use strnlen() in __set_task_comm (Thorsten Blum)

- update task_struct->comm comment (Thorsten Blum)

* tag 'execve-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
sched: update task_struct->comm comment
exec: use strnlen() in __set_task_comm

+4 -7
+1 -1
fs/exec.c
··· 1074 1074 */ 1075 1075 void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec) 1076 1076 { 1077 - size_t len = min(strlen(buf), sizeof(tsk->comm) - 1); 1077 + size_t len = strnlen(buf, sizeof(tsk->comm) - 1); 1078 1078 1079 1079 trace_task_rename(tsk, buf); 1080 1080 memcpy(tsk->comm, buf, len);
+3 -6
include/linux/sched.h
··· 1163 1163 /* 1164 1164 * executable name, excluding path. 1165 1165 * 1166 - * - normally initialized begin_new_exec() 1167 - * - set it with set_task_comm() 1168 - * - strscpy_pad() to ensure it is always NUL-terminated and 1169 - * zero-padded 1170 - * - task_lock() to ensure the operation is atomic and the name is 1171 - * fully updated. 1166 + * - normally initialized by begin_new_exec() 1167 + * - set it with set_task_comm() to ensure it is always 1168 + * NUL-terminated and zero-padded 1172 1169 */ 1173 1170 char comm[TASK_COMM_LEN]; 1174 1171