0
votes

I am trying to register a TPM driver in Linux. While Compiling, I am able to get the .ko output file but get the errors listed below. In my opinion, this has to do with the linux headers on my machine which maybe missing the defintions of these functions. I upgraded both the linux headers and the kernel to the latest version but still getting the issue.

Since these functions are not being recognized, modprobe fails with the same error (unknown symbol err0 on these functions).

Building modules, stage 2. Building with KERNELRELEASE = 4.4.0-45-generic MODPOST 2 modules WARNING: "tpm_open" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_read" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_remove_hardware" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_release" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_show_pubek" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_show_caps" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_write" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_register_hardware" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_store_cancel" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined! WARNING: "tpm_show_pcrs" [/home/burwani/Desktop/tpm_act2_driver_poc/tpm_act2_driver/tpm_act2.ko] undefined!

1

1 Answers

0
votes

You are building against kernel 4.4.0-45-generic. It seems to me that methods like tpm_open() and tpm_read() were declared in a header file only in older kernels than 4.4, and that the last kernel in which they were declared in the tpm.h header file is 3.9: http://lxr.free-electrons.com/source/drivers/char/tpm/tpm.h?v=3.9

Could it be that you are basing your code on a kernel module which was built against a kernel whose version is <= 3.9?

In kernel 4.4, you will not find these methods in the tpm.h header file.

The tpm_open() is defined as a static method in kernel 4.4.

I believe that also the other methods which you see as "undefined" when you try to modprobe your module are defined as static.