Skip to content

Commit

Permalink
libkmod: refactor builtin module handling
Browse files Browse the repository at this point in the history
Remove arbitrary limits due to file sizes (INTPR_MAX check). Reduce
amount of system calls by up to 90 % utilizing stream functions.

Also make sure that no TOCTOU could ever happen by not iterating
through the file twice: First to figure out amount of strings, then
parsing them. If the file changes in between, this can lead to
memory corruption.

Even though more memory allocations might occur due to strbuf usage,
performance generally increased by heavy reduction of system calls.

Signed-off-by: Tobias Stoeckmann <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Link: #136
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
stoeckmann authored and lucasdemarchi committed Sep 23, 2024
1 parent fb22058 commit 1005e99
Showing 1 changed file with 111 additions and 251 deletions.
Loading

0 comments on commit 1005e99

Please sign in to comment.