Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • kernel
  • auditfilter.c
Find file BlameHistoryPermalink
  • Ricardo Robaina's avatar
    audit: use task_tgid_nr() instead of task_pid_nr() · 61c60977
    Ricardo Robaina authored Aug 28, 2024
    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: default avatarRichard Guy Briggs <rgb@redhat.com>
    Signed-off-by: default avatarRicardo Robaina <rrobaina@redhat.com>
    Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
    61c60977
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7