Re: [bpf-next v1 1/2] bpf: Fix iter/task tid filtering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 15, 2024 at 11:33 AM Jordan Rome <linux@xxxxxxxxxxxxxx> wrote:
>
> In userspace, you can add a tid filter by setting
> the "task.tid" field for "bpf_iter_link_info".
> However, `get_pid_task` when called for the
> `BPF_TASK_ITER_TID` type should have been using
> `PIDTYPE_PID` (tid) instead of `PIDTYPE_TGID` (pid).
>
> Fixes: f0d74c4da1f0 ("bpf: Parameterize task iterators.")
> Signed-off-by: Jordan Rome <linux@xxxxxxxxxxxxxx>
> ---
>  kernel/bpf/task_iter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

This change is an important fix, so it has to target bpf tree, please
use [PATCH bpf] subject prefix

> diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
> index 02aa9db8d796..5af9e130e500 100644
> --- a/kernel/bpf/task_iter.c
> +++ b/kernel/bpf/task_iter.c
> @@ -99,7 +99,7 @@ static struct task_struct *task_seq_get_next(struct bpf_iter_seq_task_common *co
>                 rcu_read_lock();
>                 pid = find_pid_ns(common->pid, common->ns);
>                 if (pid) {
> -                       task = get_pid_task(pid, PIDTYPE_TGID);
> +                       task = get_pid_task(pid, PIDTYPE_PID);
>                         *tid = common->pid;
>                 }
>                 rcu_read_unlock();
> --
> 2.43.5
>





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux