From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DFA1C433FE for ; Mon, 18 Oct 2021 13:26:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A6C861260 for ; Mon, 18 Oct 2021 13:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbhJRN3F (ORCPT ); Mon, 18 Oct 2021 09:29:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:40174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbhJRN16 (ORCPT ); Mon, 18 Oct 2021 09:27:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F20F16103D; Mon, 18 Oct 2021 13:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563547; bh=rvsvVO5Xy1rsi14PHe8eAjf9UGx0G65KJ+aNPwgGFNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dfj0tmWgXL0p15VeTqAyN9AgHSuurvqsXmobjrqhT2sYYXOKHMyEBJfG/9l+2go46 FgPPyWcsWQMC6n6EFtpQ1Ga7qRQNipSCrVq8f0+C+iiKACsTt7iAWH2G2jPsSr2GcG Y/+NDWjmrWfcU766qR0dExnQjmxsVdAxkJg5XP24= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sasha Levin Subject: [PATCH 4.14 01/39] stable: clamp SUBLEVEL in 4.14 Date: Mon, 18 Oct 2021 15:24:10 +0200 Message-Id: <20211018132325.476752539@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132325.426739023@linuxfoundation.org> References: <20211018132325.426739023@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sasha Levin Right now SUBLEVEL is overflowing, and some userspace may start treating 4.14.256 as 4.15. 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.14 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 Signed-off-by: Greg Kroah-Hartman --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -1162,7 +1162,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