0

I have a simple question about modules in the linux kernel.

Is it guaranteed that my compiled module works throughout the whole X.Y kernel release.

X: Kernel version Y: Major version Z: Minor version

So for example:

I compile my module.ko with the tree of a 4.9 Kernel. Then it is possible to insmod my module with 4.9.24, 4.9.31,4.9.34,...?

So does the vermagic comparison skip everything after the major number?

Appyx
  • 1,145
  • 1
  • 12
  • 21

1 Answers1

0

Are you familiar with https://github.com/torvalds/linux/blob/master/Documentation/process/stable-api-nonsense.rst ?

If you want stable ABI you need to target kernels shipped with RHEL or SLES (or their derivatives which claim to maintain the ABI).

  • Yes. But i just want to know if it can change between minor versions^^ – Appyx Jun 17 '17 at 22:00
  • 1
    most of the time it does not, but as stated in the document there is no guarantee whatsoever –  Jun 17 '17 at 22:02
  • but how does the vermagic comparison work then? It doesn't know when something changes... – Appyx Jun 17 '17 at 22:03
  • 1
    `how does the vermagic comparison work then? It doesn't know when something changes.` - Version is generated based on the size of the types, used for function's arguments. So vermagic is able to detect some changes in API. – Tsyvarev Jun 18 '17 at 08:19