From: Sasha Levin Date: Sat, 6 Feb 2021 15:02:51 +0000 (-0500) Subject: Fixes for 4.9 X-Git-Tag: v4.14.220~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbd662836fb72eae115f801b083feeac61dc8116;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.9 Signed-off-by: Sasha Levin --- diff --git a/queue-4.9/series b/queue-4.9/series index 355efeafa1d..c29bd8a8f36 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -15,3 +15,4 @@ scsi-libfc-avoid-invoking-response-handler-twice-if-.patch mac80211-fix-fast-rx-encryption-check.patch scsi-ibmvfc-set-default-timeout-to-avoid-crash-durin.patch objtool-don-t-fail-on-missing-symbol-table.patch +stable-clamp-sublevel-in-4.4-and-4.9.patch diff --git a/queue-4.9/stable-clamp-sublevel-in-4.4-and-4.9.patch b/queue-4.9/stable-clamp-sublevel-in-4.4-and-4.9.patch new file mode 100644 index 00000000000..d41f920e6b8 --- /dev/null +++ b/queue-4.9/stable-clamp-sublevel-in-4.4-and-4.9.patch @@ -0,0 +1,46 @@ +From 4ad953f1a55ea3823a890a9132d12f3b20d210d6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 5 Feb 2021 12:47:02 -0500 +Subject: stable: clamp SUBLEVEL in 4.4 and 4.9 + +Right now SUBLEVEL is overflowing, and some userspace may start treating +4.9.256 as 4.10. 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.9 and 4.4 kernels in the form +of clamping their 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 +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 69af44d3dcd14..93f7ce06fc8c9 100644 +--- a/Makefile ++++ b/Makefile +@@ -1141,7 +1141,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 + +-- +2.27.0 +