aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorRicardo Robaina <[email protected]>2024-08-28 11:25:06 +0000
committerPaul Moore <[email protected]>2024-08-28 20:48:28 +0000
commit61c60977926e15716f469577797cd86d0369cbaa (patch)
tree0975824921e24fff52b27855c82f52632725f8c5 /security/selinux/hooks.c
parentLinux 6.11-rc1 (diff)
downloadkernel-61c60977926e15716f469577797cd86d0369cbaa.tar.gz
kernel-61c60977926e15716f469577797cd86d0369cbaa.zip
audit: use task_tgid_nr() instead of task_pid_nr()
In a few audit records, PIDs were being recorded with task_pid_nr() instead of task_tgid_nr(). $ grep "task_pid_nr" kernel/audit*.c audit.c: task_pid_nr(current), auditfilter.c: pid = task_pid_nr(current); auditsc.c: audit_log_format(ab, " pid=%u", task_pid_nr(current)); For single-thread applications, the process id (pid) and the thread group id (tgid) are the same. However, on multi-thread applications, task_pid_nr() returns the current thread id (user-space's TID), while task_tgid_nr() returns the main thread id (user-space's PID). Since the users are more interested in the process id (pid), rather than the thread id (tid), this patch converts these callers to the correct method. Link: https://github.com/linux-audit/audit-kernel/issues/126 Reviewed-by: Richard Guy Briggs <[email protected]> Signed-off-by: Ricardo Robaina <[email protected]> Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions