Commit dce44e03b0a3448ad11ac6c6e0cbe299e0400791
1 parent
81993e81a9
Exists in
master
and in
13 other branches
compat: Fix sparse address space warnings
In compat_sys_old_getrlimit() we pass a kernel pointer to sys_old_getrlimit() inside a set_fs() bracket. This is okay, so we can safely cast the affected pointer to __user. In compat_clock_nanosleep_restart(), the variable "rmtp" holds a user pointer. Annotate it as such. Both of these warnings are ancient, but were reported by Fengguang Wu's test system due to other changes. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Toyo Abe <toyoa@mvista.com> Link: http://lkml.kernel.org/n/tip-507h7cq5e45eg6ygtykon3bf@git.kernel.org
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
kernel/compat.c
... | ... | @@ -451,7 +451,7 @@ |
451 | 451 | mm_segment_t old_fs = get_fs(); |
452 | 452 | |
453 | 453 | set_fs(KERNEL_DS); |
454 | - ret = sys_old_getrlimit(resource, &r); | |
454 | + ret = sys_old_getrlimit(resource, (struct rlimit __user *)&r); | |
455 | 455 | set_fs(old_fs); |
456 | 456 | |
457 | 457 | if (!ret) { |
... | ... | @@ -799,7 +799,7 @@ |
799 | 799 | long err; |
800 | 800 | mm_segment_t oldfs; |
801 | 801 | struct timespec tu; |
802 | - struct compat_timespec *rmtp = restart->nanosleep.compat_rmtp; | |
802 | + struct compat_timespec __user *rmtp = restart->nanosleep.compat_rmtp; | |
803 | 803 | |
804 | 804 | restart->nanosleep.rmtp = (struct timespec __user *) &tu; |
805 | 805 | oldfs = get_fs(); |