sysprogs / kgdboe

A network interface for GDB for Linux Kernel
60 stars 25 forks source link

Warn about untested network drivers #14

Open disconnect3d opened 1 year ago

disconnect3d commented 1 year ago

This commit adds detection for the driver used by the provided network interface and if an untested one is used (like igb, for which things halted for me) a warning is printed.

This may help users to find out that they used wrong interface or a driver.

sysprogs commented 1 year ago

Thanks, this is a great idea to warn the users about the untested driver, however it has one minor drawback. If the user decides to try KGDBoE nonetheless, they would need to rebuild it again. The current implementation would also break the compatibility with our VisualKernel product, that expects the module to load regardless of the driver.

Perhaps, a more flexible approach would be to have a shell script that checks the current network driver against the list of tested drivers, warns if it's unsupported, and then loads (and possibly builds) the module? It could also save the users the need to manually pass the address of kallsyms_lookup_name when loading the module.

disconnect3d commented 1 year ago

I agree. We can put that code out of the module into a script and have additional functionalities added to it like: 1) build the module 2) sign the module 3) load the module with a given network interface which would get kallsyms_lookup_name from /proc/kallsyms and warn about untested drivers

disconnect3d commented 1 year ago

Btw it seems we can fetch the kernel module addresses by using kprobes: https://github.com/xcellerator/linux_kernel_hacking/issues/3#issuecomment-757994563

sysprogs commented 1 year ago

Agreed, sounds great.