mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: linux-kernel@vger.kernel.org
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Dominik Brodowski" <linux@dominikbrodowski.net>,
	"Cyrill Gorcunov" <gorcunov@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	YueHaibing <yuehaibing@huawei.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	"Jann Horn" <jannh@google.com>,
	"Kees Cook" <keescook@chromium.org>
Subject: [PATCH] kernel/sys.c: Fix UNAME26 for 5.0
Date: Mon,  7 Jan 2019 19:03:05 +0100	[thread overview]
Message-ID: <20190107180306.16602-1-j.neuschaefer@gmx.net> (raw)

UNAME26 is a mechanism to report Linux's version as 2.6.x, for
compatibility with old/broken software. Because of the way it is
implemented, it needs to be adjusted to handle version 5.0.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
 kernel/sys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index a48cbf1414b8..479f4ecdb405 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1208,6 +1208,7 @@ DECLARE_RWSEM(uts_sem);
  * Work around broken programs that cannot handle "Linux 3.0".
  * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
  * And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
+ * We map 5.x to 2.6.81+x, so 5.0 would be 2.6.81.
  */
 static int override_release(char __user *release, size_t len)
 {
@@ -1227,7 +1228,7 @@ static int override_release(char __user *release, size_t len)
 				break;
 			rest++;
 		}
-		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
+		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 81;
 		copy = clamp_t(size_t, len, 1, sizeof(buf));
 		copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
 		ret = copy_to_user(release, buf, copy + 1);
-- 
2.20.1


             reply	other threads:[~2019-01-07 18:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 18:03 Jonathan Neuschäfer [this message]
2019-01-07 18:10 ` Linus Torvalds
2019-01-08  0:08   ` Jonathan Neuschäfer
2019-01-12 17:14   ` [PATCH v2] kernel/sys.c: Clarify that UNAME26 does not generate unique versions anymore Jonathan Neuschäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190107180306.16602-1-j.neuschaefer@gmx.net \
    --to=j.neuschaefer@gmx.net \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gorcunov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®