Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Fix iter/task tid filtering #7877

Open
wants to merge 3 commits into
base: bpf-next_base
Choose a base branch
from

Conversation

jordalgo
Copy link
Contributor

No description provided.

Kernel Patches Daemon and others added 3 commits October 11, 2024 12:41
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: f0d74c4 ("bpf: Parameterize task iterators.")
Signed-off-by: Jordan Rome <[email protected]>
Previously test_task_tid was setting `linfo.task.tid`
to `getpid()` which is the same as `gettid()` for the
parent process. Instead create a new child thread
and set `linfo.task.tid` to `gettid()` to make sure
the tid filtering logic is working as expected.

Signed-off-by: Jordan Rome <[email protected]>
@jordalgo jordalgo marked this pull request as ready for review October 14, 2024 18:18
@jordalgo jordalgo changed the title Patches fix tid filtering bpf: Fix iter/task tid filtering Oct 14, 2024
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 3 times, most recently from 98d6d35 to 030207b Compare October 16, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant