syscalls: do not conceal BPF_PROG_* syscall errors#334
Closed
cyphar wants to merge 1 commit intocilium:masterfrom
Closed
syscalls: do not conceal BPF_PROG_* syscall errors#334cyphar wants to merge 1 commit intocilium:masterfrom
cyphar wants to merge 1 commit intocilium:masterfrom
Conversation
7cf7600 to
26565c8
Compare
lmb
reviewed
Jul 1, 2021
512de7d to
c0a6c42
Compare
The error wrapping code for BPF_PROG_* syscall-related errors would mask the true source of all underlying syscall errors, which meant that you couldn't detect several fairly important cases (such as -EACESS and -EPERM). It seems that this behaviour wasn't intentional (prior to commit de57e91, the behaviour was to bubble up the syscall error) and the similar wrapping of BPF_MAP_* errors did bubble up the syscall error too. This is needed for runc to be able to detect permission errors due to SELinux labels blocking certain operations (mainly NewProgramFromID), and unifies the behaviour for BPF_PROG_* and BPF_MAP_* syscalls. It turns out that wrapMapError doesn't actually wrap the either error, but lmb said they will come up with a better long term solution, so leave this alone for now. Fixes: de57e91 ("Add *GetNextID") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
c0a6c42 to
23adcaa
Compare
Contributor
Author
|
#336 fixes this in a much nicer way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The error wrapping code for BPF_PROG_* syscall-related errors would mask
the true source of all underlying syscall errors, which meant that you
couldn't detect several fairly important cases (such as -EACESS and
-EPERM). It seems that this behaviour wasn't intentional (prior to
commit de57e91, the behaviour was to bubble up the syscall error)
and the similar wrapping of BPF_MAP_* errors did bubble up the syscall
error too.
This is needed for runc to be able to detect permission errors due to
SELinux labels blocking certain operations (mainly NewProgramFromID),
and unifies the behaviour for BPF_PROG_* and BPF_MAP_* syscalls.
It turns out that wrapMapError doesn't actually wrap the either error,
but @lmb said they will come up with a better long term solution, so
leave this alone for now.
Ref: opencontainers/runc#3055
Fixes: de57e91 ("Add *GetNextID")
Signed-off-by: Aleksa Sarai cyphar@cyphar.com