summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSasha Levin <sashal@kernel.org>2021-02-05 12:47:02 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-22 09:19:00 +0100
commita256aac5b7000bdf1232ed2bbd674582c0ab27ec (patch)
treee0eb0821e84e6b2634276e40fdcbbfc0c592de2d /Makefile
parent5fd3cce374df811af0c71585bc3d1096b04da9c9 (diff)
downloadlinux-stable-a256aac5b7000bdf1232ed2bbd674582c0ab27ec.tar.gz
linux-stable-a256aac5b7000bdf1232ed2bbd674582c0ab27ec.tar.bz2
linux-stable-a256aac5b7000bdf1232ed2bbd674582c0ab27ec.zip
stable: clamp SUBLEVEL in 4.19
In a few months, SUBLEVEL will overflow, and some userspace may start treating 4.19.256 as 4.20. While out of tree modules have different ways of extracting the version number (and we're generally ok with breaking them), we do care about breaking userspace and it would appear that this overflow might do just that. Our rules around userspace ABI in the stable kernel are pretty simple: we don't break it. Thus, while userspace may be checking major/minor, it shouldn't be doing anything with sublevel. This patch applies a big band-aid to the 4.19 kernel in the form of clamping the sublevel to 255. The clamp is done for the purpose of LINUX_VERSION_CODE only, and extracting the version number from the Makefile or "make kernelversion" will continue to work as intended. We might need to do it later in newer trees, but maybe we'll have a better solution by then, so I'm ignoring that problem for now. Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c0676abcf60f..baa5c43b8e65 100644
--- a/Makefile
+++ b/Makefile
@@ -1158,7 +1158,7 @@ endef
define filechk_version.h
(echo \#define LINUX_VERSION_CODE $(shell \
- expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
+ expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
endef