-
Notifications
You must be signed in to change notification settings - Fork 141
bpf path iterator #9134
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 path iterator #9134
Conversation
Upstream branch: f66b4aa |
13e07b5
to
ca6e071
Compare
Upstream branch: a633dab |
a433010
to
060bb73
Compare
ca6e071
to
2f8bb38
Compare
Upstream branch: 85cd83f |
060bb73
to
d0296e8
Compare
2f8bb38
to
dd96e0b
Compare
Upstream branch: f5527f0 |
d0296e8
to
1939654
Compare
dd96e0b
to
9860b87
Compare
This helper walks an input path to its parent. Logic are added to handle walking across mount tree. This will be used by landlock, and BPF LSM. Suggested-by: Neil Brown <[email protected]> Signed-off-by: Song Liu <[email protected]>
Use path_walk_parent() to walk a path up to its parent. No functional changes intended. Signed-off-by: Song Liu <[email protected]>
Introduce a path iterator, which walks a struct path toward the root. This path iterator is based on path_walk_parent. A fixed zero'ed root is passed to path_walk_parent(). Therefore, unless the user terminates it earlier, the iterator will terminate at the real root. Signed-off-by: Song Liu <[email protected]> Acked-by: Andrii Nakryiko <[email protected]>
Upstream branch: bd07bd1 |
Add tests for bpf path iterator, including test cases similar to real workload (call bpf_path_d_path and bpf_get_dentry_xattr), and test cases where the verifier rejects invalid use of the iterator. Signed-off-by: Song Liu <[email protected]>
Add an end-to-end test with path_iter on security hook file_open. A test file is created in folder /tmp/test_progs_path_iter/folder. On file_open, walk file->f_path up to its parent and grand parent, and test bpf_get_dentry_xattr and bpf_path_d_path on the folders. Signed-off-by: Song Liu <[email protected]>
1939654
to
f21ef91
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=972802 expired. Closing PR. |
Pull request for series with
subject: bpf path iterator
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=972802