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

How to run AF_XDP program without root privileges? #119

Open
Baruch-Fridman opened this issue Jun 26, 2024 · 2 comments
Open

How to run AF_XDP program without root privileges? #119

Baruch-Fridman opened this issue Jun 26, 2024 · 2 comments

Comments

@Baruch-Fridman
Copy link

I want to run a userspace program to create AF_XDP socket and receive packet through this socket, but withput "sudo" and/or sysadmin capillitia.
It is possible?
I tried this xdp-project/xdp-tools#320 (comment) https://next.redhat.com/2023/07/18/using-ebpf-in-unprivileged-pods/ solution on ubuntu 22.04 kernel v6.5 but it doesn't work.
any idea?

@tohojo
Copy link
Member

tohojo commented Jun 27, 2024 via email

@Baruch-Fridman
Copy link
Author

Baruch-Fridman @.***> writes:
I want to run a userspace program to create AF_XDP socket and receive packet through this socket, but withput "sudo" and/or sysadmin capillitia. It is possible?
Not natively, no. Using AF_XDP requires loading an XDP program, which is a privileged operation. There have been various attempts at creating a policy daemon that can do this on behalf of applications, but I don't believe any of them have really matured yet...

Thanks
I found this https://www.spinics.net/lists/netdev/msg705394.html, but I haven't actually checked yet.
here is an example https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/tests/test_xsk_non_privileged.c
and also here

" -R, --reduce-cap Use reduced capabilities (cannot be used with -M)\n"

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

No branches or pull requests

2 participants