* [tip:x86/x32] compat: Fix sparse address space warnings
@ 2014-02-03 2:03 tip-bot for H. Peter Anvin
0 siblings, 0 replies; only message in thread
From: tip-bot for H. Peter Anvin @ 2014-02-03 2:03 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, toyoa, hpa, mingo, tglx, hpa
Commit-ID: dce44e03b0a3448ad11ac6c6e0cbe299e0400791
Gitweb: http://git.kernel.org/tip/dce44e03b0a3448ad11ac6c6e0cbe299e0400791
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Sun, 2 Feb 2014 17:57:28 -0800
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Sun, 2 Feb 2014 18:00:29 -0800
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
---
kernel/compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/compat.c b/kernel/compat.c
index 3afc524..7076b57 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -451,7 +451,7 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
- ret = sys_old_getrlimit(resource, &r);
+ ret = sys_old_getrlimit(resource, (struct rlimit __user *)&r);
set_fs(old_fs);
if (!ret) {
@@ -799,7 +799,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
long err;
mm_segment_t oldfs;
struct timespec tu;
- struct compat_timespec *rmtp = restart->nanosleep.compat_rmtp;
+ struct compat_timespec __user *rmtp = restart->nanosleep.compat_rmtp;
restart->nanosleep.rmtp = (struct timespec __user *) &tu;
oldfs = get_fs();
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-03 2:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-03 2:03 [tip:x86/x32] compat: Fix sparse address space warnings tip-bot for H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox