From: Kees Cook <keescook@chromium.org>
To: Roman Pen <r.peniaev@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>,
Christoffer Dall <christoffer.dall@linaro.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Sekhar Nori <nsekhar@ti.com>,
Andy Lutomirski <luto@amacapital.net>,
Eric Paris <eparis@redhat.com>, Will Deacon <will.deacon@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] ARM: entry-common,ptrace: do not pass scno to syscall_trace_enter
Date: Tue, 13 Jan 2015 12:08:48 -0800 [thread overview]
Message-ID: <CAGXu5jLi=6QTzF_z9pFAeXQqLZPfSCcwZc+q-a7b-tKwwBo4vg@mail.gmail.com> (raw)
In-Reply-To: <1420986751-30364-3-git-send-email-r.peniaev@gmail.com>
On Sun, Jan 11, 2015 at 6:32 AM, Roman Pen <r.peniaev@gmail.com> wrote:
> In previous patch current_thread_info()->syscall is set with
> corresponding syscall number prior to further calls, thus there
> is no any need to pass 'scno'.
>
> Also, add explicit comment why do we have to reread 'scno' local
> variable.
>
> Signed-off-by: Roman Pen <r.peniaev@gmail.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Eric Paris <eparis@redhat.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
> arch/arm/kernel/entry-common.S | 1 -
> arch/arm/kernel/ptrace.c | 6 ++++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
> index 89452ff..3d12eb5 100644
> --- a/arch/arm/kernel/entry-common.S
> +++ b/arch/arm/kernel/entry-common.S
> @@ -228,7 +228,6 @@ ENDPROC(vector_swi)
> * context switches, and waiting for our parent to respond.
> */
> __sys_trace:
> - mov r1, scno
> add r0, sp, #S_OFF
> bl syscall_trace_enter
>
> diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
> index ef9119f..1238787 100644
> --- a/arch/arm/kernel/ptrace.c
> +++ b/arch/arm/kernel/ptrace.c
> @@ -928,9 +928,9 @@ static void tracehook_report_syscall(struct pt_regs *regs,
> regs->ARM_ip = ip;
> }
>
> -asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
> +asmlinkage int syscall_trace_enter(struct pt_regs *regs)
> {
> - current_thread_info()->syscall = scno;
> + int scno = current_thread_info()->syscall;
Was this assignment of current_thread_info()->syscall redundant? If
so, this looks fine. If not, what will now be setting the thread_info?
-Kees
>
> /* Do the secure computing check first; failures should be fast. */
> #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
> @@ -944,6 +944,8 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
> if (test_thread_flag(TIF_SYSCALL_TRACE))
> tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
>
> + /* Syscall can be aborted (-1 can be set) or even changed
> + * by the tracer and subsequent PTRACE_SET_SYSCALL request */
> scno = current_thread_info()->syscall;
>
> if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> --
> 2.1.3
>
--
Kees Cook
Chrome OS Security
next prev parent reply other threads:[~2015-01-13 20:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-11 14:32 [PATCH 0/2] ARM: set thread_info->syscall just before sys_* execution Roman Pen
2015-01-11 14:32 ` [PATCH 1/2] ARM: entry-common: fix forgotten set of thread_info->syscall Roman Pen
2015-01-12 18:39 ` Will Deacon
2015-01-13 8:35 ` Roman Peniaev
2015-01-14 2:23 ` Roman Peniaev
2015-01-14 20:51 ` Kees Cook
2015-01-15 1:54 ` Roman Peniaev
2015-01-15 22:54 ` Kees Cook
2015-01-16 15:57 ` Roman Peniaev
2015-01-16 15:59 ` Russell King - ARM Linux
2015-01-16 16:08 ` Roman Peniaev
2015-01-16 16:17 ` Russell King - ARM Linux
2015-01-16 19:57 ` Kees Cook
2015-01-16 23:54 ` Kees Cook
2015-01-19 5:58 ` Roman Peniaev
2015-01-20 18:56 ` Kees Cook
2015-01-19 9:20 ` Will Deacon
2015-01-20 18:31 ` Kees Cook
2015-01-20 22:45 ` Russell King - ARM Linux
2015-01-20 23:04 ` Russell King - ARM Linux
2015-01-21 23:32 ` Kees Cook
2015-01-22 1:24 ` Roman Peniaev
2015-01-22 18:07 ` Kees Cook
2015-01-23 4:17 ` Roman Peniaev
2015-01-11 14:32 ` [PATCH 2/2] ARM: entry-common,ptrace: do not pass scno to syscall_trace_enter Roman Pen
2015-01-13 20:08 ` Kees Cook [this message]
2015-01-13 23:21 ` Roman Peniaev
2015-01-13 23:43 ` Kees Cook
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='CAGXu5jLi=6QTzF_z9pFAeXQqLZPfSCcwZc+q-a7b-tKwwBo4vg@mail.gmail.com' \
--to=keescook@chromium.org \
--cc=christoffer.dall@linaro.org \
--cc=eparis@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=luto@amacapital.net \
--cc=nsekhar@ti.com \
--cc=r.peniaev@gmail.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=will.deacon@arm.com \
/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).