Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941159AbcJXP6s (ORCPT ); Mon, 24 Oct 2016 11:58:48 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55822 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933767AbcJXP6r (ORCPT ); Mon, 24 Oct 2016 11:58:47 -0400 Subject: Re: [PATCH] ARC: return -EFAULT on failed access_ok for arc_usr_cmpxchg syscall To: Vineet Gupta , Jiri Slaby , Andrew Morton , linux-snps-arc@lists.infradead.org References: <20161024104714.10047-1-colin.king@canonical.com> <92d0dd5e-8aa8-3e55-193f-1fa440cb3ff3@synopsys.com> Cc: linux-kernel@vger.kernel.org From: Colin Ian King Message-ID: Date: Mon, 24 Oct 2016 16:58:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <92d0dd5e-8aa8-3e55-193f-1fa440cb3ff3@synopsys.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1071 Lines: 36 On 24/10/16 16:56, Vineet Gupta wrote: > On 10/24/2016 03:47 AM, Colin King wrote: >> From: Colin Ian King >> >> 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 >> --- >> 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. Sure, squash it int and add me as a Reviewed-by. Colin > > Thx, > -Vineet > >