SUSE / clang-extract

Other
7 stars 3 forks source link

Decompress ELF objects e.g. kernel modules #63

Open marcosps opened 4 days ago

marcosps commented 4 days ago

Curerntly clang-extract doesn't deal with ELF objects that are compressed, like kernel modules. Having this implemented on clang-extract would make it easier to integrate it with different distributions, without having to reset to zstd extraction on /lib/modules for example.

giulianobelinassi commented 4 days ago

We have two options here:

The first option has the disadvantage that libzstd will be placed as a dependency of clang-extract, but we can workaround that by using dlopen and dlsym. The second option have an disadvantage that it will be clunky and potentially slow.

marcosps commented 11 hours ago

I was checking libkmod, which can help to extract all current formats that kernel supports. All distros should package libkmod, since it's part of the kmod project (modprobe, modinfo, etc...). I may need more time to think more about it, but if this trully happens, we may be able to create livepatches from people's own /usr/src/linux and /lib/modules, instead of having to complie their own kernels.

(The only missing piece would be compile_commands.json, but that is being worked ATM)