From: Michael Ellerman <mpe@ellerman.id.au>
To: "Dmitry V. Levin" <ldv@altlinux.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
Eugene Syromyatnikov <esyr@redhat.com>,
Elvira Khabirova <lineprinter@altlinux.org>,
Andy Lutomirski <luto@kernel.org>,
Breno Leitao <leitao@debian.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call
Date: Thu, 22 Nov 2018 08:17:25 +1100 [thread overview]
Message-ID: <87efbe166y.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20181119210139.GA8360@altlinux.org>
Hi Dmitry,
Thanks for the patch.
"Dmitry V. Levin" <ldv@altlinux.org> writes:
> From: Elvira Khabirova <lineprinter@altlinux.org>
>
> Arch code should use tracehook_*() helpers as documented
> in include/linux/tracehook.h,
> ptrace_report_syscall() is not expected to be used outside that file.
>
> Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
> Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU")
> Signed-off-by: Elvira Khabirova <lineprinter@altlinux.org>
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
>
> v3: add a descriptive comment
> v2: explicitly ignore tracehook_report_syscall_entry() return code
>
> arch/powerpc/kernel/ptrace.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index afb819f4ca68..e84220d91bbd 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -3266,7 +3266,12 @@ long do_syscall_trace_enter(struct pt_regs *regs)
> user_exit();
>
> if (test_thread_flag(TIF_SYSCALL_EMU)) {
> - ptrace_report_syscall(regs);
> + /*
> + * A nonzero return code from tracehook_report_syscall_entry()
> + * tells us to prevent the syscall execution, but we are not
> + * going to execute it anyway.
> + */
> + (void) tracehook_report_syscall_entry(regs);
Unfortunately the (void) cast doesn't work to suppress the must check
warning.
arch/powerpc/kernel/ptrace.c:3274:3: error: ignoring return value of 'tracehook_report_syscall_entry', declared with attribute warn_unused_result [-Werror=unused-result]
AFAIK we don't have a way to suppress that.
I guess we should rewrite it to only call
tracehook_report_syscall_entry() once, like x86 does.
I'll try and get a patch for that done & tested.
cheers
next prev parent reply other threads:[~2018-11-21 21:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 11:17 [PATCH v2] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call Elvira Khabirova
2018-11-16 12:42 ` Michael Ellerman
2018-11-19 21:01 ` [PATCH v3] " Dmitry V. Levin
2018-11-21 21:17 ` Michael Ellerman [this message]
2018-12-03 3:18 ` [PATCH v4] " Dmitry V. Levin
2018-12-07 1:19 ` Dmitry V. Levin
2018-12-07 11:12 ` Michael Ellerman
2018-12-07 15:42 ` Dmitry V. Levin
2018-12-07 15:56 ` [PATCH v5] " Dmitry V. Levin
2018-12-07 18:52 ` [PATCH v6] " Dmitry V. Levin
2018-12-10 13:28 ` Oleg Nesterov
2018-12-10 13:36 ` Dmitry V. Levin
2018-12-16 17:28 ` [PATCH] powerpc/ptrace: cleanup do_syscall_trace_enter Dmitry V. Levin
2018-12-17 11:20 ` Michael Ellerman
2018-12-17 11:23 ` Dmitry V. Levin
2018-12-17 11:27 ` Oleg Nesterov
2018-12-22 9:54 ` Michael Ellerman
2018-12-11 13:45 ` [v5] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call Michael Ellerman
2018-12-07 16:34 ` [PATCH v4] " Oleg Nesterov
2018-12-07 18:42 ` Dmitry V. Levin
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=87efbe166y.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=esyr@redhat.com \
--cc=ldv@altlinux.org \
--cc=leitao@debian.org \
--cc=lineprinter@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luto@kernel.org \
--cc=oleg@redhat.com \
--cc=paulus@samba.org \
/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).