]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: update execve() syscall probe support
authorKris Van Hees <kris.van.hees@oracle.com>
Thu, 7 Feb 2013 21:36:26 +0000 (16:36 -0500)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:41:42 +0000 (22:41 +0100)
The execve syscall stub and entry syscall function changed from 3.6 to 3.7 to
no longer pass a pointer to the registers from the stub to the entry syscall
function.  Instead, the entry syscall function now retrieves the registers
using current_pt_regs(), and passes it to the do_execve() function.  The DTrace
stub and override function have been updated to use the same mechanism.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
kernel/dtrace/dtrace_os.c
kernel/dtrace/dtrace_stubs_x86_64.S

index ce13292d57fdceb7cc167a417a577cea1a95039f..f58e669db409e8f9dd21241f06c99c0464e74dd0 100644 (file)
@@ -784,12 +784,13 @@ long dtrace_vfork(struct pt_regs *regs)
 
 long dtrace_execve(const char __user *name,
                   const char __user *const __user *argv,
-                  const char __user *const __user *envp, struct pt_regs *regs)
+                  const char __user *const __user *envp)
 {
        long                    rc = 0;
        dtrace_id_t             id;
        dtrace_syscalls_t       *sc;
-       char                    *filename;
+       struct filename         *path;
+       struct pt_regs          *regs = current_pt_regs();
 
        sc = &systrace_info.sysent[__NR_execve];
 
@@ -801,14 +802,12 @@ long dtrace_execve(const char __user *name,
         * FIXME: Add stop functionality for DTrace.
         */
 
-       filename = getname(name);
-       rc = PTR_ERR(filename);
-       if (IS_ERR(filename))
+       path = getname(name);
+       rc = PTR_ERR(path);
+       if (IS_ERR(path))
                goto out;
-
-       rc = do_execve(filename, argv, envp, regs);
-
-       putname(filename);
+       rc = do_execve(path->name, argv, envp, regs);
+       putname(path);
 
 out:
        if ((id = sc->stsy_return) != DTRACE_IDNONE)
index dde72e3d959c14877ab37b3bb6706c1dbf2d9662..39620b2ef1e2f9cef6039a686df2396eb4f262c5 100644 (file)
@@ -170,7 +170,6 @@ ENTRY(dtrace_stub_execve)
        PARTIAL_FRAME 0
        SAVE_REST
        FIXUP_TOP_OF_STACK %r11
-       movq %rsp, %rcx
        call dtrace_execve
        RESTORE_TOP_OF_STACK %r11
        movq %rax,RAX(%rsp)