Skip to content

security: Allow more LSM callbacks than available slots#5

Open
PaulRenauld wants to merge 1 commit intorfcfrom
remove-panic
Open

security: Allow more LSM callbacks than available slots#5
PaulRenauld wants to merge 1 commit intorfcfrom
remove-panic

Conversation

@PaulRenauld
Copy link
Copy Markdown
Owner

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.

__static_call_update(slot->key, slot->trampoline,
pos->hook.generic_func);
slot++;
if (slot_idx >= 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be if slot_idx < SECURITY_STATIC_SLOT_COUNT?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
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

Successfully merging this pull request may close these issues.

2 participants