-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llext: fix handling of unimplemented syscalls
When building an LLEXT-enabled kernel, 62b19ef added weak aliases of all syscall implementation functions to a pointer to NULL, with the assumption that LLEXT would check the required symbols at link time and fail if any of them were found. This check, however, is ineffective in the current implementation: the actual address that is exported is the rather normal-looking location of the variable containing the NULL pointer. This defeats the NULL symbol validity checks in llext_link.c and causes the extension to crash at runtime by jumping to a location containing a few zeroes in read-only data memory. This commit makes sure the alias target is actually placed at address 0 using the llext-sections.ld linker fragment, so that undefined syscall implementations are exported as NULLs and as such properly flagged at link time. The test for this functionality is also updated to reflect the change. Signed-off-by: Luca Burelli <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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