Disagrees about version of symbol symbol_name after insmod

You need to build your kernel module against the same version kernel you are going to run. Thus if you have kernel 4.3 sources that you have downloaded you need to compile that version of the kernel and boot with that running before trying to load your kernel.

You have two solutions then:

  1. Download the kernel sources for the kernel you are currently running (you can install those with zypper install kernel-source on SLES or an equivalent command on other distributions.)
  2. Compile and install the 4.3 kernel in to your operating system. If you need help with this then ask a separate question (and it probably belongs on superuser not here). Note that if kernel and glibc are tightly coupled, and it is possible that you can't run a new kernel if you have a very old C library.

make -C /lib/modules/$(uname -r)/build M=$PWD modules, "$(uname -r)" shows that you are compiling against the kernel version you are running now so you should be able to insmod the module in the current kernel if you haven't changed the headers.

From your text, "Just for checking I have copied a few files from the kernel directories into my project directory. Made changes to it and inserted a few more code to it."

If you have made modifications to the kernel source then you may need to recompile the new kernel and boot with the new updated kernel. Then you should be able to compile your kernel module with the modified headers.


The problem here is that your Kernel module is using the exported symbols of other kernel modules which in this case appears to be the linux InfiniBand RDMA stack's exported methods or symbols.

To solve the symbol version problems, copy the Module.symvers file from the

/usr/src/ofa-kernel

directory and paste it to your current working directory. Then you make your modules again. Now the insmod should work perfectly fine.

NOTE: The Module.symvers file contains information of all the kernel module exported symbol. So by copying it to your working directory, you are helping kbuild to know more about the used exported symbols.

And if you don't find Module.symvers or it is empty, then create one using create_Module.symvers.sh