public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: patchwork-bot+linux-riscv@kernel.org
To: Celeste Liu <coelacanthushex@gmail.com>
Cc: linux-riscv@lists.infradead.org, palmer@rivosinc.com,
	paul.walmsley@sifive.com, aou@eecs.berkeley.edu,
	guoren@kernel.org, bjorn@rivosinc.com,
	conor.dooley@microchip.com, linux-kernel@vger.kernel.org,
	schwab@suse.de, David.Laight@ACULAB.COM,
	CoelacanthusHex@gmail.com, felixonmars@archlinux.org,
	c141028@gmail.com, shiqi@isrc.iscas.ac.cn,
	emil.renner.berthing@canonical.com
Subject: Re: [PATCH v5] riscv: entry: set a0 = -ENOSYS only when syscall != -1
Date: Thu, 17 Aug 2023 15:20:24 +0000	[thread overview]
Message-ID: <169228562472.20811.8481326212732586626.git-patchwork-notify@kernel.org> (raw)
In-Reply-To: <20230801141607.435192-1-CoelacanthusHex@gmail.com>

Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue,  1 Aug 2023 22:15:16 +0800 you wrote:
> When we test seccomp with 6.4 kernel, we found errno has wrong value.
> If we deny NETLINK_AUDIT with EAFNOSUPPORT, after f0bddf50586d, we will
> get ENOSYS instead. We got same result with commit 9c2598d43510 ("riscv:
> entry: Save a0 prior syscall_enter_from_user_mode()").
> 
> After analysing code, we think that regs->a0 = -ENOSYS should only be
> executed when syscall != -1. In __seccomp_filter, when seccomp rejected
> this syscall with specified errno, they will set a0 to return number as
> syscall ABI, and then return -1. This return number is finally pass as
> return number of syscall_enter_from_user_mode, and then is compared with
> NR_syscalls after converted to ulong (so it will be ULONG_MAX). The
> condition syscall < NR_syscalls will always be false, so regs->a0 = -ENOSYS
> is always executed. It covered a0 set by seccomp, so we always get
> ENOSYS when match seccomp RET_ERRNO rule.
> 
> [...]

Here is the summary with links:
  - [v5] riscv: entry: set a0 = -ENOSYS only when syscall != -1
    https://git.kernel.org/riscv/c/52449c17bdd1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



  reply	other threads:[~2023-08-17 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 14:15 [PATCH v5] riscv: entry: set a0 = -ENOSYS only when syscall != -1 Celeste Liu
2023-08-17 15:20 ` patchwork-bot+linux-riscv [this message]
2024-06-27  7:14 ` Dmitry V. Levin
2024-06-27  7:47   ` Celeste Liu
2024-06-27  8:10     ` Andreas Schwab
2024-06-27  9:35       ` Celeste Liu
2024-06-27  9:43     ` Björn Töpel
2024-06-27  9:52       ` Dmitry V. Levin
2024-06-27 10:23         ` Björn Töpel
2024-06-27 10:11       ` Celeste Liu
2024-06-27 10:38       ` Celeste Liu

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=169228562472.20811.8481326212732586626.git-patchwork-notify@kernel.org \
    --to=patchwork-bot+linux-riscv@kernel.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=aou@eecs.berkeley.edu \
    --cc=bjorn@rivosinc.com \
    --cc=c141028@gmail.com \
    --cc=coelacanthushex@gmail.com \
    --cc=conor.dooley@microchip.com \
    --cc=emil.renner.berthing@canonical.com \
    --cc=felixonmars@archlinux.org \
    --cc=guoren@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=schwab@suse.de \
    --cc=shiqi@isrc.iscas.ac.cn \
    /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