mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Drewry <wad@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: kees.cook@canonical.com, eparis@redhat.com, agl@chromium.org,
	mingo@elte.hu, jmorris@namei.org, rostedt@goodmis.org,
	Will Drewry <wad@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 7/7] arch/x86: hook int returning system calls
Date: Wed, 27 Apr 2011 22:08:51 -0500	[thread overview]
Message-ID: <1303960136-14298-6-git-send-email-wad@chromium.org> (raw)
In-Reply-To: <1303960136-14298-1-git-send-email-wad@chromium.org>

Using the newly specified __SYSCALL_DEFINEx helpers, redefine
int-returning system calls with the macro to enable ftrace access.

Signed-off-by: Will Drewry <wad@chromium.org>
---
 arch/x86/kernel/ldt.c |    5 +++--
 arch/x86/kernel/tls.c |    7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index ea69726..3f1160c 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -10,6 +10,7 @@
 #include <linux/gfp.h>
 #include <linux/sched.h>
 #include <linux/string.h>
+#include <linux/syscalls.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/vmalloc.h>
@@ -245,8 +246,8 @@ out:
 	return error;
 }
 
-asmlinkage int sys_modify_ldt(int func, void __user *ptr,
-			      unsigned long bytecount)
+__SYSCALL_DEFINEx(asmlinkage, int, 3, _modify_ldt,
+		  int, func, void __user *, ptr, unsigned long, bytecount)
 {
 	int ret = -ENOSYS;
 
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 6bb7b85..0f27a6b 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -1,6 +1,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/syscalls.h>
 #include <linux/user.h>
 #include <linux/regset.h>
 
@@ -90,7 +91,8 @@ int do_set_thread_area(struct task_struct *p, int idx,
 	return 0;
 }
 
-asmlinkage int sys_set_thread_area(struct user_desc __user *u_info)
+__SYSCALL_DEFINEx(asmlinkage, int, 1, _set_thread_area,
+		  struct user_desc __user *, u_info)
 {
 	int ret = do_set_thread_area(current, -1, u_info, 1);
 	asmlinkage_protect(1, ret, u_info);
@@ -140,7 +142,8 @@ int do_get_thread_area(struct task_struct *p, int idx,
 	return 0;
 }
 
-asmlinkage int sys_get_thread_area(struct user_desc __user *u_info)
+__SYSCALL_DEFINEx(asmlinkage, int, 1, _get_thread_area,
+		  struct user_desc __user *, u_info)
 {
 	int ret = do_get_thread_area(current, -1, u_info);
 	asmlinkage_protect(1, ret, u_info);
-- 
1.7.0.4


      parent reply	other threads:[~2011-04-28  3:11 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28  3:08 [PATCH 2/7] tracing: split out syscall_trace_enter construction Will Drewry
2011-04-28  3:08 ` [PATCH 3/7] seccomp_filter: Enable ftrace-based system call filtering Will Drewry
2011-04-28 13:50   ` Steven Rostedt
2011-04-28 15:30     ` Will Drewry
2011-04-28 16:20       ` Serge E. Hallyn
2011-04-28 16:56       ` Steven Rostedt
2011-04-28 18:02         ` Will Drewry
2011-04-28 14:29   ` Frederic Weisbecker
2011-04-28 15:15     ` Will Drewry
2011-04-28 15:57       ` Frederic Weisbecker
2011-04-28 16:05         ` Will Drewry
2011-04-28 15:12   ` Frederic Weisbecker
2011-04-28 15:20     ` Frederic Weisbecker
2011-04-28 15:29     ` Will Drewry
2011-04-28 16:13       ` Frederic Weisbecker
2011-04-28 16:48         ` Will Drewry
2011-04-28 17:36           ` Frederic Weisbecker
2011-04-28 18:21             ` Will Drewry
2011-04-28 16:28   ` Steven Rostedt
2011-04-28 16:53     ` Will Drewry
2011-04-28 16:55   ` Serge E. Hallyn
2011-04-28 17:16     ` Steven Rostedt
2011-04-28 17:39       ` Serge E. Hallyn
2011-04-28 18:01         ` Will Drewry
2011-04-28 18:21           ` Steven Rostedt
2011-04-28 18:34             ` Will Drewry
2011-04-28 18:54               ` Serge E. Hallyn
2011-04-28 19:07                 ` Steven Rostedt
2011-04-28 19:06               ` Steven Rostedt
2011-04-28 18:51           ` Serge E. Hallyn
2011-05-03  8:39   ` Avi Kivity
2011-04-28  3:08 ` [PATCH 4/7] seccomp_filter: add process state reporting Will Drewry
2011-04-28  3:21   ` KOSAKI Motohiro
2011-04-28  3:24     ` Will Drewry
2011-04-28  3:40       ` Al Viro
2011-04-28  3:43         ` Will Drewry
2011-04-28 22:54       ` James Morris
2011-05-02 10:08         ` Will Drewry
2011-05-12  3:04   ` [PATCH 4/5] v2 " Will Drewry
2011-04-28  3:08 ` [PATCH 5/7] seccomp_filter: Document what seccomp_filter is and how it works Will Drewry
2011-04-28  7:06   ` Ingo Molnar
2011-04-28 14:56     ` Eric Paris
2011-04-28 18:37       ` Will Drewry
2011-04-29 13:18         ` Frederic Weisbecker
2011-04-29 16:13           ` Will Drewry
2011-05-03  1:29             ` Frederic Weisbecker
2011-05-03  1:47               ` Frederic Weisbecker
2011-05-04  9:15                 ` Will Drewry
2011-05-04  9:29                   ` Will Drewry
2011-05-04 17:52                   ` Frederic Weisbecker
2011-05-04 18:23                     ` Steven Rostedt
2011-05-04 18:30                       ` Frederic Weisbecker
2011-05-04 18:46                         ` Steven Rostedt
2011-05-05  9:21                           ` Will Drewry
2011-05-05 13:14                             ` Serge E. Hallyn
2011-05-12  3:20                               ` Will Drewry
2011-05-06 11:53                             ` Steven Rostedt
2011-05-06 13:35                               ` Eric Paris
2011-05-07  1:58                               ` Will Drewry
2011-05-12  3:04                                 ` [PATCH 5/5] v2 " Will Drewry
2011-05-06 16:30                             ` [PATCH 5/7] " Eric Paris
2011-05-07  2:11                               ` Will Drewry
2011-05-04 12:16                 ` Steven Rostedt
2011-05-04 15:54                   ` Eric Paris
2011-05-04 16:06                     ` Steven Rostedt
2011-05-04 16:22                       ` Eric Paris
2011-05-04 16:39                         ` Steven Rostedt
2011-05-04 18:02                           ` Eric Paris
2011-05-04 17:03                         ` Frederic Weisbecker
2011-05-04 17:55                           ` Eric Paris
2011-04-28 17:43     ` Serge E. Hallyn
2011-04-28 15:46   ` Randy Dunlap
2011-04-28 18:23     ` Will Drewry
2011-04-28  3:08 ` [PATCH 6/7] include/linux/syscalls.h: add __ layer of macros with return types Will Drewry
2011-04-28  3:08 ` Will Drewry [this message]

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=1303960136-14298-6-git-send-email-wad@chromium.org \
    --to=wad@chromium.org \
    --cc=agl@chromium.org \
    --cc=eparis@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®