[Dev] External kernel module building and kernel ABI/API check.

Artem Bityutskiy artem.bityutskiy at linux.intel.com
Fri Dec 20 15:39:53 GMT 2013

On Fri, 2013-12-20 at 16:23 +0100, Łukasz Stelmach wrote:
> It was <2013-12-13 pią 13:04>, when Artem Bityutskiy wrote:
> > On Fri, 2013-12-13 at 12:27 +0100, Łukasz Stelmach wrote:
> >>> Why not to just rebuilt them every time the kernel package changes,
> >>> I wonder? Do you have hundreds of them out-of-tree modules?
> >> 
> >> It isn't about our modules, they can be rebuilt with OBS, but rather
> >> about third party ones used/provided by OEMs outside of Tizen
> >> repositories.
> >
> > I'd think that you either guarantee that ABI/API check is 100% correct,
> > or just force external modules to recompile whenever the kernel changes.
> We'd lik to make builds fail if ABI changes to prevent applying patches
> that break ABI.

The document I referred before explains that the internal kernel
functions are not a stable ABI. They change all the time. You can spend
a lot of time and efforts trying to notice the changes, and you are
never going to be 100% correct. But if you have idle resources, please,
go for it, I do not mind. You can be quite accurate, and start believing
the system works, until you get a big surprize with a major OEM because
semantics of one of the internal function changed (but not API)...

Kernel stable API and ABI are syscalls, ioctl's, sysfs and proc stuff,
known netlink interfaces, etc. Those people try hard to not break, and
Linus bashes those who break them badly.

Modules use internal kernel functions. API and _semantics_ of those
change all the time.

> Yet another idea is to somehow (we don't have a solution ready yet) use
> RPM dependencies to alert OEMs building their images that they need to
> recompile their (or maybe even fourth party) modules.

Modules have to be build exactly for the kernel they are going to run
in. This is what you need to make sure.

You can store hash of the kernel sources you built against all modules.
Then make the kernel verify this hash against its own copy. If they
mismatch - prevent loading.

Then OEM has 2 choices:
  1. Recompile against the right code-base
  2. use modrpobe --force - then they take the risk. They should be
     to face possible issues.

Best Regards,
Artem Bityutskiy

More information about the Dev mailing list