Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507340

Re: [PATCH] ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Vineet Gupta <Vineet.Gupta1@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall
Date Mon, 24 Oct 2016 18:00:01 +0200
Message-ID <svPPj-1bs-7@gated-at.bofh.it> (permalink)
References <svKZj-6tF-3@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0
MIME-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding 7bit
X-Originating-IP [10.10.161.43]
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 29
Organization linux.* mail to news gateway
X-Original-Cc <linux-kernel@vger.kernel.org>
X-Original-Date Mon, 24 Oct 2016 08:56:48 -0700
X-Original-Message-ID <92d0dd5e-8aa8-3e55-193f-1fa440cb3ff3@synopsys.com>
X-Original-Newsgroups gmane.linux.kernel,gmane.linux.kernel.arc
X-Original-References <20161024104714.10047-1-colin.king@canonical.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1507340

Show key headers only | View raw


On 10/24/2016 03:47 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> arc_usr_cmpxchg currently returns an uninitialized value in ret
> on a failed access_ok call. Instead, return -EFAULT.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  arch/arc/kernel/process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arc/kernel/process.c b/arch/arc/kernel/process.c
> index a746008..9ae3e1c 100644
> --- a/arch/arc/kernel/process.c
> +++ b/arch/arc/kernel/process.c
> @@ -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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall Colin King <colin.king@canonical.com> - 2016-10-24 12:50 +0200
  Re: [PATCH] ARC: return -EFAULT on failed access_ok for  arc_usr_cmpxchg syscall Colin Ian King <colin.king@canonical.com> - 2016-10-24 18:00 +0200
  Re: [PATCH] ARC: return -EFAULT on failed access_ok for  arc_usr_cmpxchg syscall Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-24 18:00 +0200

csiph-web