-
Notifications
You must be signed in to change notification settings - Fork 205
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
Issue in permissions checking in nvcgo/internal/cgroup/ebpf.go ? #227
Comments
oOraph
changed the title
Issue in permissions checking in nvcgo/internal/cgroup/ebpf.go
Issue in permissions checking in nvcgo/internal/cgroup/ebpf.go ?
Oct 26, 2023
Note that I got confirmation that there is indeed an issue: the check should rather be https://github.com/containers/crun/blob/main/src/libcrun/ebpf.c#L220 And even so it's still arbitrary anyway because then we check for a match with the device permissions at the time of the bpf program forgery, not the time of the bpf program execution |
oOraph
added a commit
to oOraph/libnvidia-container
that referenced
this issue
Nov 7, 2023
Related to: NVIDIA#227 Signed-off-by: Raphael <[email protected]>
Allan-Nava
pushed a commit
to HiWay-Media/libnvidia-container
that referenced
this issue
Dec 5, 2023
Related to: NVIDIA#227 Signed-off-by: Raphael Glon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm probably missing something here. Can someone explain me this code part ?
https://github.com/NVIDIA/libnvidia-container/blob/main/src/nvcgo/internal/cgroup/ebpf.go#L139C4-L139C4
R3 & bpfAccess == 0
is not enough is it ?example:
device access permissions: r _ _ (
bpfAccess == unix.BPF_DEVCG_ACC_READ
)device access request: r w _ (
R3 = unix.BPF_DEVCG_ACC_READ | unix.BPF_DEVCG_ACC_WRITE
)then
R3 & bpfAccess != 0
which makes the device a potential candidate to be accepted for write permissions despite the device access being only read ?Am I missing something ?
Shouldn't we rather have something like this ?
The text was updated successfully, but these errors were encountered: