ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall
PATCH 1/1 ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall
From: Colin Ian King <[email protected]>
arc_usr_cmpxchg currently returns an uninitialized value in ret on a failed access_ok call. Instead, return -EFAULT.
--- arch/arc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arc/kernel/process.c +1 -1
@@ -47,7 +47,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)int ret;if (!access_ok (VERIFY_WRITE , uaddr,sizeof (int ))) -return ret; +return -EFAULT ;preempt_disable ();
Signature · 1 line
2.9.3
Quoted 15 lines · Colin King
From: Colin Ian King <colin.king at canonical.com>
arc_usr_cmpxchgcurrently returns an uninitialized value in ret on a failedaccess_okcall. Instead, return-EFAULT.Signed-off-by Colin Ian King <colin.king at canonical.com>--- arch/arc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arc/kernel/process.c +0
-0
arch/arc/kernel/process.c SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new) · line 52
Quoted 7 lines
arch/arc/kernel/process.c +1
-1@@ -47,7 +47,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)int ret;if (!access_ok (VERIFY_WRITE , uaddr,sizeof (int ))) -return ret; +return -EFAULT ;preempt_disable ();
Thx for spotting this. Since this is new code, not yet merged, do you mind if I squash it with orig patch. I can add a Reviewed-by a SOB as you prefer.
Thx,
-Vineet
Quoted 18 lines · Vineet Gupta
Quoted 17 lines · Colin King
From: Colin Ian King <colin.king at canonical.com>
arc_usr_cmpxchgcurrently returns an uninitialized value in ret on a failedaccess_okcall. Instead, return-EFAULT.Signed-off-by Colin Ian King <colin.king at canonical.com>--- arch/arc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arc/kernel/process.c +0
-0@@ -47,7 +47,7 @@ SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)int ret;
Quoted 8 lines
arch/arc/kernel/process.c SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new) · line 52
Quoted 5 lines
arch/arc/kernel/process.c +1
-1if (!access_ok (VERIFY_WRITE , uaddr,sizeof (int ))) -return ret; +return -EFAULT ;preempt_disable ();Thx for spotting this. Since this is new code, not yet merged, do you mind if I squash it with orig patch. I can add a Reviewed-by a SOB as you prefer.
Sure, squash it int and add me as a Reviewed-by.
Colin
Quoted 5 lines
Thx,
-Vineet