Wednesday, February 10, 2016

kABI-tracking kmod packages

Our kmod packages are "kABI-tracking". The drivers they provide will work across all Enterprise Linux (EL) kernel releases, meaning there is no need to reinstall them upon each kernel update. But what is the kABI?

The Kernel Application Binary Interface (kABI) is a set of in-kernel symbols used by drivers and other kernel modules. Each major and minor RHEL kernel release has a set of in-kernel symbols that are whitelisted. A kABI-tracking kmod package contains a kernel module that is compatible with a given kABI, that is, for a given major and minor release of the EL kernel.

However, in some cases the drivers use symbols that are not whitelisted in the RHEL kernel and these kernel symbols can change between releases. If a driver uses such kernel symbols, then the driver will not be backward compatible with older, previously released kernels.

How can we check if a kmod package uses non-whitelisted kABI symbols? In EL-6, EL-7, and EL8, install the following two packages:

yum install kernel-abi-whitelists ksc

Locate the module file (*.ko) and run the command:

ksc -k <module_name>.ko

For example:

$ ksc -k /lib/modules/2.6.32-358.el6.x86_64/extra/it87/it87.ko
Checking against architecture x86_64
Total symbol usage: 45 Total Non white list symbol usage: 4
Score: 91.11%

A copy of the report is saved in /home/bob/ksc-result.txt


In the above example, user "bob" has performed the check.

[Note] Due to a bug in the ksc package, it will not work for EL 6.7. More details and an easy fix can be found in Red Hat bug #1272348.