All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Pen <r.peniaev@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Roman Pen <r.peniaev@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Christoffer Dall <christoffer.dall@linaro.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Sekhar Nori <nsekhar@ti.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 1/2] ARM: entry-common: fix forgotten set of thread_info->syscall
Date: Sun, 11 Jan 2015 23:32:30 +0900	[thread overview]
Message-ID: <1420986751-30364-2-git-send-email-r.peniaev@gmail.com> (raw)
In-Reply-To: <1420986751-30364-1-git-send-email-r.peniaev@gmail.com>

thread_info->syscall is used only for ptrace, but syscall number
is also used by syscall_get_nr and returned to userspace by the
following proc file access:

 $ cat /proc/self/syscall
 0 0x3 0xbe928bd8 0x1000 0x0 0xac9e0 0x3 0xbe928bb4 0xb6f5dfbc
 ^
The first number is the syscall number, currently it is zero.
Patch fixes this:

 $ cat /proc/self/syscall
 3 0x3 0xbefc7bd8 0x1000 0x0 0xac9e0 0x3 0xbefc7bb4 0xb6e82fbc
 ^
Right, read syscall

Signed-off-by: Roman Pen <r.peniaev@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
---
 arch/arm/kernel/asm-offsets.c  | 1 +
 arch/arm/kernel/entry-common.S | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 2d2d608..6911bad 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -70,6 +70,7 @@ int main(void)
   DEFINE(TI_CPU,		offsetof(struct thread_info, cpu));
   DEFINE(TI_CPU_DOMAIN,		offsetof(struct thread_info, cpu_domain));
   DEFINE(TI_CPU_SAVE,		offsetof(struct thread_info, cpu_context));
+  DEFINE(TI_SYSCALL,		offsetof(struct thread_info, syscall));
   DEFINE(TI_USED_CP,		offsetof(struct thread_info, used_cp));
   DEFINE(TI_TP_VALUE,		offsetof(struct thread_info, tp_value));
   DEFINE(TI_FPSTATE,		offsetof(struct thread_info, fpstate));
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index f8ccc21..89452ff 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -189,6 +189,7 @@ ENTRY(vector_swi)
 #endif
 
 local_restart:
+	str scno, [tsk, #TI_SYSCALL]		@ set syscall number
 	ldr	r10, [tsk, #TI_FLAGS]		@ check for syscall tracing
 	stmdb	sp!, {r4, r5}			@ push fifth and sixth args
 
-- 
2.1.3


WARNING: multiple messages have this Message-ID (diff)
From: r.peniaev@gmail.com (Roman Pen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: entry-common: fix forgotten set of thread_info->syscall
Date: Sun, 11 Jan 2015 23:32:30 +0900	[thread overview]
Message-ID: <1420986751-30364-2-git-send-email-r.peniaev@gmail.com> (raw)
In-Reply-To: <1420986751-30364-1-git-send-email-r.peniaev@gmail.com>

thread_info->syscall is used only for ptrace, but syscall number
is also used by syscall_get_nr and returned to userspace by the
following proc file access:

 $ cat /proc/self/syscall
 0 0x3 0xbe928bd8 0x1000 0x0 0xac9e0 0x3 0xbe928bb4 0xb6f5dfbc
 ^
The first number is the syscall number, currently it is zero.
Patch fixes this:

 $ cat /proc/self/syscall
 3 0x3 0xbefc7bd8 0x1000 0x0 0xac9e0 0x3 0xbefc7bb4 0xb6e82fbc
 ^
Right, read syscall

Signed-off-by: Roman Pen <r.peniaev@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Cc: stable at vger.kernel.org
---
 arch/arm/kernel/asm-offsets.c  | 1 +
 arch/arm/kernel/entry-common.S | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 2d2d608..6911bad 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -70,6 +70,7 @@ int main(void)
   DEFINE(TI_CPU,		offsetof(struct thread_info, cpu));
   DEFINE(TI_CPU_DOMAIN,		offsetof(struct thread_info, cpu_domain));
   DEFINE(TI_CPU_SAVE,		offsetof(struct thread_info, cpu_context));
+  DEFINE(TI_SYSCALL,		offsetof(struct thread_info, syscall));
   DEFINE(TI_USED_CP,		offsetof(struct thread_info, used_cp));
   DEFINE(TI_TP_VALUE,		offsetof(struct thread_info, tp_value));
   DEFINE(TI_FPSTATE,		offsetof(struct thread_info, fpstate));
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index f8ccc21..89452ff 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -189,6 +189,7 @@ ENTRY(vector_swi)
 #endif
 
 local_restart:
+	str scno, [tsk, #TI_SYSCALL]		@ set syscall number
 	ldr	r10, [tsk, #TI_FLAGS]		@ check for syscall tracing
 	stmdb	sp!, {r4, r5}			@ push fifth and sixth args
 
-- 
2.1.3

  reply	other threads:[~2015-01-11 14:33 UTC|newest]

Thread overview: 78+ 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 ` Roman Pen
2015-01-11 14:32 ` Roman Pen [this message]
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-12 18:39     ` Will Deacon
2015-01-12 18:39     ` Will Deacon
2015-01-13  8:35     ` Roman Peniaev
2015-01-13  8:35       ` Roman Peniaev
2015-01-13  8:35       ` Roman Peniaev
2015-01-14  2:23       ` Roman Peniaev
2015-01-14  2:23         ` Roman Peniaev
2015-01-14  2:23         ` Roman Peniaev
2015-01-14 20:51       ` Kees Cook
2015-01-14 20:51         ` Kees Cook
2015-01-14 20:51         ` Kees Cook
2015-01-15  1:54         ` Roman Peniaev
2015-01-15  1:54           ` Roman Peniaev
2015-01-15  1:54           ` Roman Peniaev
2015-01-15 22:54           ` Kees Cook
2015-01-15 22:54             ` Kees Cook
2015-01-15 22:54             ` Kees Cook
2015-01-16 15:57             ` Roman Peniaev
2015-01-16 15:57               ` Roman Peniaev
2015-01-16 15:57               ` Roman Peniaev
2015-01-16 15:59               ` Russell King - ARM Linux
2015-01-16 15:59                 ` Russell King - ARM Linux
2015-01-16 15:59                 ` Russell King - ARM Linux
2015-01-16 16:08                 ` Roman Peniaev
2015-01-16 16:08                   ` Roman Peniaev
2015-01-16 16:08                   ` Roman Peniaev
2015-01-16 16:17                   ` Russell King - ARM Linux
2015-01-16 16:17                     ` Russell King - ARM Linux
2015-01-16 16:17                     ` Russell King - ARM Linux
2015-01-16 19:57                     ` Kees Cook
2015-01-16 19:57                       ` Kees Cook
2015-01-16 19:57                       ` Kees Cook
2015-01-16 23:54                       ` Kees Cook
2015-01-16 23:54                         ` Kees Cook
2015-01-16 23:54                         ` Kees Cook
2015-01-19  5:58                         ` Roman Peniaev
2015-01-19  5:58                           ` Roman Peniaev
2015-01-19  5:58                           ` Roman Peniaev
2015-01-20 18:56                           ` Kees Cook
2015-01-20 18:56                             ` Kees Cook
2015-01-20 18:56                             ` Kees Cook
2015-01-19  9:20                         ` Will Deacon
2015-01-19  9:20                           ` Will Deacon
2015-01-19  9:20                           ` Will Deacon
2015-01-20 18:31                           ` Kees Cook
2015-01-20 18:31                             ` Kees Cook
2015-01-20 18:31                             ` Kees Cook
2015-01-20 22:45                             ` Russell King - ARM Linux
2015-01-20 22:45                               ` Russell King - ARM Linux
2015-01-20 22:45                               ` Russell King - ARM Linux
2015-01-20 23:04                               ` Russell King - ARM Linux
2015-01-20 23:04                                 ` Russell King - ARM Linux
2015-01-20 23:04                                 ` Russell King - ARM Linux
2015-01-21 23:32                                 ` Kees Cook
2015-01-21 23:32                                   ` Kees Cook
2015-01-21 23:32                                   ` Kees Cook
2015-01-22  1:24                                   ` Roman Peniaev
2015-01-22  1:24                                     ` Roman Peniaev
2015-01-22  1:24                                     ` Roman Peniaev
2015-01-22 18:07                                     ` Kees Cook
2015-01-22 18:07                                       ` Kees Cook
2015-01-22 18:07                                       ` Kees Cook
2015-01-23  4:17                                       ` Roman Peniaev
2015-01-23  4:17                                         ` Roman Peniaev
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-11 14:32   ` [PATCH 2/2] ARM: entry-common, ptrace: " Roman Pen
2015-01-13 20:08   ` [PATCH 2/2] ARM: entry-common,ptrace: " Kees Cook
2015-01-13 20:08     ` [PATCH 2/2] ARM: entry-common, ptrace: " Kees Cook
2015-01-13 23:21     ` [PATCH 2/2] ARM: entry-common,ptrace: " Roman Peniaev
2015-01-13 23:21       ` [PATCH 2/2] ARM: entry-common, ptrace: " Roman Peniaev
2015-01-13 23:43       ` [PATCH 2/2] ARM: entry-common,ptrace: " Kees Cook
2015-01-13 23:43         ` [PATCH 2/2] ARM: entry-common, ptrace: " 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=1420986751-30364-2-git-send-email-r.peniaev@gmail.com \
    --to=r.peniaev@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=nsekhar@ti.com \
    --cc=stable@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.