-
Notifications
You must be signed in to change notification settings - Fork 149
Remove use of current->cgns in bpf_cgroup_from_id #9449
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
Conversation
Upstream branch: fa47913 |
2a0e5cd
to
2562e0e
Compare
Upstream branch: 9e293d4 |
cc06450
to
790159b
Compare
2562e0e
to
5583eb6
Compare
Upstream branch: 3e2b799 |
790159b
to
8ea0e96
Compare
5583eb6
to
601ea2d
Compare
Upstream branch: c93c59b |
8ea0e96
to
16c9ccc
Compare
601ea2d
to
7390c2c
Compare
The bpf_cgroup_from_id kfunc relies on cgroup_get_from_id to obtain the cgroup corresponding to a given cgroup ID. This helper can be called in a lot of contexts where the current thread can be random. A recent example was its use in sched_ext's ops.tick(), to obtain the root cgroup pointer. Since the current task can be whatever random user space task preempted by the timer tick, this makes the behavior of the helper unreliable. Resolve this by refactoring cgroup_get_from_id to take a parameter to elide the cgroup_is_descendant check when root_cgns parameter is set to true. There is no compatibility breakage here, since changing the namespace against which the lookup is being done to the root cgroup namespace only permits a wider set of lookups to succeed now. The cgroup IDs across namespaces are globally unique, and thus don't need to be retranslated. Reported-by: Dan Schatzberg <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
Upstream branch: bf0c2a8 |
Make sure that we only switch the cgroup namespace and enter a new cgroup in a child process separate from test_progs, to not mess up the environment for subsequent tests. Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
16c9ccc
to
a31133a
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=990210 expired. Closing PR. |
Pull request for series with
subject: Remove use of current->cgns in bpf_cgroup_from_id
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=990210