Support verification of built-in Linux kernel modules
Some time ago Klever could verify built-in Linux kernel modules like loadable ones pretty well. But in Klever 2.0 this was broken.
Updated by Evgeny Novikov 14 days ago
- Status changed from Resolved to Open
Pavel detected the following exception:
Raise exception: Traceback (most recent call last): File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/components.py", line 395, in run self.main() File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/components.py", line 304, in callbacks_caller ret = attr(*args, **kwargs) File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/pfg/__init__.py", line 49, in generate_program_fragments attr_data, pairs = strategy.fragmentation(fset, tactic_name, fset_name) File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/pfg/fragmentation/__init__.py", line 85, in fragmentation self.tactic.get("ignore missing files")) File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/pfg/abstractions/__init__.py", line 44, in init self.__divide(skip_missing_files) File "/home/alpha/git/klever/venv/lib/python3.7/site-packages/klever/core/pfg/abstractions/__init__.py", line 424, in __divide raise RuntimeError(msg) RuntimeError: Cannot calculate path to existing file '/home/alpha/git/linux/scripts/dtc/dtc-lexer.lex.c'
Updated by Evgeny Novikov 12 days ago
- Status changed from Open to Closed
Ilja fixed it so that no extra information is necessary to consider built-in modules absolutely like loadable ones. The branch passed tests. Moreover, I added one more preset job for testing built-in modules support. That job is a complete copy of "Loadable kernel modules sample" except for a kernel configuration ("allyesconfig" rather than "allmodconfig").
Updated by Ilja Zakharov 12 days ago
Built-in modules are selected by iterating all CC commands collected by Clade. Commands from modules have either a 'KBUILD_MODNAME' or '-DKBUILD_MODNAME' option. Klever groups input files of commands with the same value of the mentioned options to get modules even if there are linked to the kernel. This approach is used for fragmentation strategy "statically linked modules". By default, Klever is using the approach with iterating over LD commands to detect modules.
Updated by Evgeny Novikov 11 days ago
- Priority changed from Urgent to High
- Status changed from Closed to Open
It was my mistake that I merged the branch to master too early while it turned out that it is not so vital. Indeed, we need to investigate the issue better and to fix different corner cases. The current implementation is still in branch pfg-internal-modules that I hope to be completed for Klever 3.1. I reverted corresponding commits in master.