Skip to contentSkip to conversation

kernel/sys.c: Fix UNAME26 for 4.0

PATCH In review Jon DeVree 4 participants 4 messages Feb 23, 2015 – Feb 27, 2015

lore
Share & tools
lore

Jon DeVree

author
#0 lore raw

PATCH 1/1 kernel/sys.c: Fix UNAME26 for 4.0

---
 kernel/sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sys.c +1 -1
index 667b2e6..0ffd403 100644
@@ -1127,7 +1127,7 @@ static int override_release(char __user *release, size_t len)
 				break;
 			rest++;
 		}
-		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
+		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
 		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);
Signature · 1 line
2.1.4
#1 lore raw

kernel/sys.c static int override_release(char __user *release, size_t len) · line 1133

Quoted 11 lines · On Mon, 23 Feb 2015 00:43:12 -0500 Jon DeVree <[email protected]> wrote:
kernel/sys.c +1 -1
@@ -1127,7 +1127,7 @@ static int override_release(char __user *release, size_t len)
 				break;
 			rest++;
 		}
-		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
+		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
 		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);

Huh.

I wonder if we still need this.

We should update the comment:

kernel/sys.c renamed from kernel/sys.c~kernel-sysc-fix-uname26-for-40-fix +1 -0
@@ -1108,6 +1108,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.
  */
 static int override_release(char __user *release, size_t len)
 {
#2 lore raw
Quoted 16 lines · Andrew Morton

kernel/sys.c static int override_release(char __user *release, size_t len) · line 1133

Quoted 11 lines · On Mon, 23 Feb 2015 00:43:12 -0500 Jon DeVree <[email protected]> wrote:
kernel/sys.c +1 -1
@@ -1127,7 +1127,7 @@ static int override_release(char __user *release, size_t len)
 				break;
 			rest++;
 		}
-		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
+		v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
 		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);

Huh.

Quoted 1 line

I wonder if we still need this.

I think so. A lot of the world is still stuck on RHEL6 ... And compatbility to old binaries is a high value.

The original program I needed it for is fixed however.

-Andi

Quoted 16 lines

We should update the comment:

kernel/sys.c renamed from kernel/sys.c~kernel-sysc-fix-uname26-for-40-fix +1 -0
@@ -1108,6 +1108,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.
  */
 static int override_release(char __user *release, size_t len)
 {
Signature · 1 line
[email protected] -- Speaking for myself only.