[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <49419bd051ccdb64de7222e2d17aa77d@paul-moore.com>
Date: Wed, 28 Aug 2024 16:48:26 -0400
From: Paul Moore <paul@...l-moore.com>
To: Ricardo Robaina <rrobaina@...hat.com>, audit@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Ricardo Robaina <rrobaina@...hat.com>, eparis@...hat.com, rgb@...hat.com
Subject: Re: [PATCH v2] audit: use task_tgid_nr() instead of task_pid_nr()
On Aug 28, 2024 Ricardo Robaina <rrobaina@...hat.com> wrote:
>
> 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 <rgb@...hat.com>
> Signed-off-by: Ricardo Robaina <rrobaina@...hat.com>
> ---
> V1 -> V2: Added a more detailed commit description
>
> kernel/audit.c | 2 +-
> kernel/auditfilter.c | 2 +-
> kernel/auditsc.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Looks good to me, merged into audit/dev, thanks!
--
paul-moore.com
Powered by blists - more mailing lists