security: Allow more LSM callbacks than available slots#5
Open
PaulRenauld wants to merge 1 commit intorfcfrom
Open
security: Allow more LSM callbacks than available slots#5PaulRenauld wants to merge 1 commit intorfcfrom
PaulRenauld wants to merge 1 commit intorfcfrom
Conversation
bjackman
reviewed
Aug 25, 2020
| __static_call_update(slot->key, slot->trampoline, | ||
| pos->hook.generic_func); | ||
| slot++; | ||
| if (slot_idx >= 0) |
Collaborator
There was a problem hiding this comment.
Shouldn't this be if slot_idx < SECURITY_STATIC_SLOT_COUNT?
Owner
Author
There was a problem hiding this comment.
I didn't provide enough context here: the slots will hold the callbacks that are at the end of the linked list. This way, we can iterate over the first few elements of the list which are not in the slots.
E.g. if we have 10 slots and 15 callbacks, slot_idx will be -5 at first. It will skip the first 5 elements in the list, and then start adding the callbacks to the slots.
Introduce a slow path fallback when the number of callbacks for a LSM hook is greater than the number of defined static slots. The static slots are filled, and the callbacks that do not fit are called using the linked list before the static calls.
da9cc86 to
cc5ba51
Compare
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.
Introduce a slow path fallback when the number of callbacks for a
LSM hook is greater than the number of defined static slots.
The static slots are filled, and the callbacks that do not fit
are called using the linked list before the static calls.