]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/sys.c
Merge tags 'compiler-attributes-for-linus-v5.0-rc3' and 'clang-format-for-linus-v5...
[linux.git] / kernel / sys.c
index 64b5a230f38d785846ff69699bd74915a77a76d1..f7eb62eceb2437d18bd3f9a7c8f8287255627015 100644 (file)
@@ -1207,7 +1207,8 @@ 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.
+ * And we map 4.x and later versions to 2.6.60+x, so 4.0/5.0/6.0/... would be
+ * 2.6.60.
  */
 static int override_release(char __user *release, size_t len)
 {
@@ -2627,7 +2628,7 @@ COMPAT_SYSCALL_DEFINE1(sysinfo, struct compat_sysinfo __user *, info)
                s.freehigh >>= bitcount;
        }
 
-       if (!access_ok(VERIFY_WRITE, info, sizeof(struct compat_sysinfo)) ||
+       if (!access_ok(info, sizeof(struct compat_sysinfo)) ||
            __put_user(s.uptime, &info->uptime) ||
            __put_user(s.loads[0], &info->loads[0]) ||
            __put_user(s.loads[1], &info->loads[1]) ||