KSM About Main Page
Get It
Documentation
Resources
My Other SF projects |
KERNEL SYMBOL MANIPULATOR MAIN PAGE
What IS IT ?Symbols exported by Linux kernel usualy has suffix something like _R12345678. This suffix is checksum calculated from function return type and parameter's types. If module use function with same name but another suffix it's mean that module and kernel have different ideas about function parameter's types. insmod will refuse load such module into the kernel, and this is good because it's prevent chaos.But algorithm used by genksyms to calculate checksum may create "false alarm" - calculate different checksum for exactly same function. Example. File example1.c void my_func(int param) { ; } EXPORT_SYMBOL(my_func); gcc -E example1.c | /sbin/genksyms -k2.2.2 Produce following output: #define __ver_my_func 6d4907cf #define my_func _set_ver(my_func) File example2.c typedef int my_int; void my_func(my_int param) { ; } EXPORT_SYMBOL(my_func); gcc -E example2.c | /sbin/genksyms -k2.2.2 Produce following output: #define __ver_my_func 2514ffd7 #define my_func _set_ver(my_func) Function my_func in both cases is pretty same: return type void, parameter type int, but checksums are different. KSM goal is to work around this problem. If you sure that function interface is same and different checksums are only genksyms artefact you can use KSM to make module "see" correct symbols. Supported platforms.KSM was tested on:
HOW IT WORKS ?ksm library wrap query_module function and make manipulation with returned data.HOW USE IT ?Instead of utilities
If you use original utilities in the scripts and don't want change them, simple set before script's invokation environment variable LD_PRELOAD. LD_PRELOAD=/usr/lib/ksm/libksm.so KSM use config file /etc/ksm.conf. This file describe how exported kernel symbols should be manipulated. If you have suggestions/ideas/bug report you can send it to forums
KSM distributed under GPL KSM was written by Valery Reznic |