linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>
Subject: Re: [PATCH 4/4] sh: bring syscall_set_return_value in line with other architectures
Date: Wed, 22 Jul 2020 23:20:35 +0000	[thread overview]
Message-ID: <bfb5f986-1d49-15e4-d1e5-74408e779ffd@physik.fu-berlin.de> (raw)
In-Reply-To: <20200722231322.419642-4-kernel@mkarcher.dialup.fu-berlin.de>

On 7/23/20 1:13 AM, Michael Karcher wrote:
> Other architectures expect that syscall_set_return_value gets an already
> negative value as error. That's also what kernel/seccomp.c provides.
> 
> Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
> ---
>  arch/sh/include/asm/syscall_32.h | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h
> index 0b5b8e75edac..cb51a7528384 100644
> --- a/arch/sh/include/asm/syscall_32.h
> +++ b/arch/sh/include/asm/syscall_32.h
> @@ -40,10 +40,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
>  					    struct pt_regs *regs,
>  					    int error, long val)
>  {
> -	if (error)
> -		regs->regs[0] = -error;
> -	else
> -		regs->regs[0] = val;
> +	regs->regs[0] = (long) error ?: val;
>  }
>  
>  static inline void syscall_get_arguments(struct task_struct *task,
> 

Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2020-07-22 23:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 23:13 [PATCH 1/4] sh: Fix validation of system call number Michael Karcher
2020-07-22 23:13 ` [PATCH 2/4] sh: Rearrange blocks in entry-common.S Michael Karcher
2020-07-22 23:20   ` John Paul Adrian Glaubitz
2020-07-22 23:13 ` [PATCH 3/4] sh: Add SECCOMP_FILTER Michael Karcher
2020-07-22 23:20   ` John Paul Adrian Glaubitz
2020-08-28 15:50   ` Rich Felker
2020-08-28 16:21     ` John Paul Adrian Glaubitz
2020-08-28 16:30     ` Rich Felker
2020-08-28 16:38       ` John Paul Adrian Glaubitz
2020-08-28 17:03         ` Rich Felker
2020-08-29  0:49           ` Rich Felker
2020-08-29 11:09             ` John Paul Adrian Glaubitz
2020-09-03  3:56               ` Rich Felker
2020-09-03  5:46                 ` Rich Felker
2020-09-03  6:04                   ` John Paul Adrian Glaubitz
2020-09-03  6:17                     ` Rich Felker
2020-09-03  6:03                 ` John Paul Adrian Glaubitz
2020-07-22 23:13 ` [PATCH 4/4] sh: bring syscall_set_return_value in line with other architectures Michael Karcher
2020-07-22 23:20   ` John Paul Adrian Glaubitz [this message]
2020-07-22 23:19 ` [PATCH 1/4] sh: Fix validation of system call number John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfb5f986-1d49-15e4-d1e5-74408e779ffd@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=dalias@libc.org \
    --cc=kernel@mkarcher.dialup.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).