Ubuntu version macros overflow with high ABI numbers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned | ||
lttng-modules (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bionic |
Triaged
|
Medium
|
Stefan Bader |
Bug Description
[SRU Justification]
== Impact ==
The kernel change (which may or may not be taken back) revealed a build issue we already have with lltng-modules and our high ABI numbers for derivative/custom kernels. It should be fixed regardless of what the kernel will do.
== Fix ==
The proposed fix changes macros which are used to do run-time adaptions of code based on the kernel version for which the DKMS modules are built for. The number keys which the macros are using are not included in the code and the way those are used will either cause build failures or produce the same code as before.
== Test case ==
Producing DKMS modules is the test case here. I did tests with the previous bionic:
== Regression Potential ==
Building DKMS modules for lttng could start to fail.
---
An upstream kernel change which was introduced to avoid high sub-level numbers in 4.14.y to overflow into the minor number has uncovered a similar issue with LTTNG's macros which allow versioned code adaptions.
To allow that the ABI number of the kernel is inserted as a new sub-sub-level number. Which is done by shifting the existing LINUX_VERSION_CODE by another 8 bits. But this only allows for ABI numbers up to 255. After that they overflow into the sub-level part of the kernel. This went unnoticed until the kernel side changed this number to be 255 fix. Now the overflow reaches the minor number and this breaks assumptions in the code.
For example bionic:
Since the macros are only used to make compile time decisions the proposed fix would be to extend the ABI number size to 16bit. That will work in all cases.
CVE References
Changed in lttng-modules (Ubuntu Bionic): | |
assignee: | nobody → Stefan Bader (smb) |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: patch |
description: | updated |
Changed in linux (Ubuntu Bionic): | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in linux (Ubuntu): | |
status: | Incomplete → Invalid |
Changed in linux (Ubuntu Bionic): | |
status: | Triaged → Fix Committed |
To avoid ambiguity what storage size the macros expand to it is probably better to force a 64bit number like some of the other distro macros do.