Skip to content

Commit 39afb5e

Browse files
nuxitorvalds
authored andcommittedFeb 28, 2015
kernel/sys.c: fix UNAME26 for 4.0
There's a uname workaround for broken userspace which can't handle kernel versions of 3.x. Update it for 4.x. Signed-off-by: Jon DeVree <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d297369 commit 39afb5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎kernel/sys.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,7 @@ DECLARE_RWSEM(uts_sem);
11081108
/*
11091109
* Work around broken programs that cannot handle "Linux 3.0".
11101110
* Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
1111+
* And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
11111112
*/
11121113
static int override_release(char __user *release, size_t len)
11131114
{
@@ -1127,7 +1128,7 @@ static int override_release(char __user *release, size_t len)
11271128
break;
11281129
rest++;
11291130
}
1130-
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
1131+
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
11311132
copy = clamp_t(size_t, len, 1, sizeof(buf));
11321133
copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
11331134
ret = copy_to_user(release, buf, copy + 1);

0 commit comments

Comments
 (0)