[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210430184757.mez7ujmyzm43g6z2@revolver>
Date: Fri, 30 Apr 2021 18:48:08 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
CC: Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Julien Grall <julien.grall@....com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: Re: [PATCH 2/3] arm64: signal: sigreturn() and rt_sigreturn()
sometime returns the wrong signals
This is way out of scope for what I'm doing. I'm trying to fix a call
to the wrong mm API. I was trying to clean up any obvious errors in
calling functions which were exposed by fixing that error. If you want
this fixed differently, then please go ahead and tackle the problems you
see.
Thank you,
Liam
* Eric W. Biederman <ebiederm@...ssion.com> [210429 13:52]:
>
> This entire discussion seems to come down to what are the expected
> semantics of arm64_notify_segfault. The use of this helper in
> swp_handler and user_cache_main_handler is clearly for the purposes of
> instruction emulation. With instruction emulation it is a bug if the
> emulated instruction behaves differently than a real instruction in
> the same circumstances.
>
> To properly fix the instruction emulation in arm64_notify_segfault it
> looks to me that the proper solution is to call __do_page_fault or
> handle_mm_fault the way do_page_fault does and them parse the VM_FAULT
> code for which signal to generate.
>
> I would probably rename arm64_notify_segfault to arm64_emulate_fault, or
> possibly arm64_notify_fault while fixing the emulation so that it
> can return different signals and so that people don't have to guess
> what the function is supposed to do.
>
> For the specific case of sigreturn and rt_sigreturn it looks sufficient
> to use the fixed arm64_notify_segfault. As it appears the that the code
> is attempting to act like it is emulating an instruction that does not
> exist.
>
>
> There is an argument that sigreturn and rt_sigreturn do a poor enough
> job of acting like the fault was caused by an instruction, as well
> as failing for other reasons it might make more sense to just have
> sigreturn and rt_sigreturn call "force_sig(SIGSEGV);" But that seems
> out of scope of what you are trying to fix right now so I would not
> worry about it.
>
> Eric
Powered by blists - more mailing lists