from Magnus Vesterlund <magnus_vesterlund@hotmail.com>.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6630
}
// Parts of this are amd64-specific, but the *PEEK* cases are generic.
-// XXX: Why is the memory pointed to by ARG3 never checked?
+//
+// ARG3 is only used for pointers into the traced process's address
+// space and for offsets into the traced process's struct
+// user_regs_struct. It is never a pointer into this process's memory
+// space, and we should therefore not check anything it points to.
PRE(sys_ptrace)
{
PRINT("sys_ptrace ( %d, %d, %p, %p )", ARG1,ARG2,ARG3,ARG4);
PRE_MEM_READ( "ptrace(setfpregs)", ARG4,
sizeof (struct vki_user_i387_struct));
break;
+ case VKI_PTRACE_GETEVENTMSG:
+ PRE_MEM_WRITE( "ptrace(geteventmsg)", ARG4, sizeof(unsigned long));
+ break;
+ case VKI_PTRACE_GETSIGINFO:
+ PRE_MEM_WRITE( "ptrace(getsiginfo)", ARG4, sizeof(vki_siginfo_t));
+ break;
+ case VKI_PTRACE_SETSIGINFO:
+ PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
+ break;
default:
break;
}
case VKI_PTRACE_GETFPREGS:
POST_MEM_WRITE( ARG4, sizeof (struct vki_user_i387_struct));
break;
+ case VKI_PTRACE_GETEVENTMSG:
+ POST_MEM_WRITE( ARG4, sizeof(unsigned long));
+ break;
+ case VKI_PTRACE_GETSIGINFO:
+ /* XXX: This is a simplification. Different parts of the
+ * siginfo_t are valid depending on the type of signal.
+ */
+ POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
+ break;
default:
break;
}
}
// Parts of this are x86-specific, but the *PEEK* cases are generic.
-// XXX: Why is the memory pointed to by ARG3 never checked?
+//
+// ARG3 is only used for pointers into the traced process's address
+// space and for offsets into the traced process's struct
+// user_regs_struct. It is never a pointer into this process's memory
+// space, and we should therefore not check anything it points to.
PRE(sys_ptrace)
{
PRINT("sys_ptrace ( %d, %d, %p, %p )", ARG1,ARG2,ARG3,ARG4);
PRE_MEM_READ( "ptrace(setfpxregs)", ARG4,
sizeof(struct vki_user_fxsr_struct) );
break;
+ case VKI_PTRACE_GETEVENTMSG:
+ PRE_MEM_WRITE( "ptrace(geteventmsg)", ARG4, sizeof(unsigned long));
+ break;
+ case VKI_PTRACE_GETSIGINFO:
+ PRE_MEM_WRITE( "ptrace(getsiginfo)", ARG4, sizeof(vki_siginfo_t));
+ break;
+ case VKI_PTRACE_SETSIGINFO:
+ PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
+ break;
default:
break;
}
case VKI_PTRACE_GETFPXREGS:
POST_MEM_WRITE( ARG4, sizeof(struct vki_user_fxsr_struct) );
break;
+ case VKI_PTRACE_GETEVENTMSG:
+ POST_MEM_WRITE( ARG4, sizeof(unsigned long));
+ break;
+ case VKI_PTRACE_GETSIGINFO:
+ /* XXX: This is a simplification. Different parts of the
+ * siginfo_t are valid depending on the type of signal.
+ */
+ POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
+ break;
default:
break;
}
typedef __vki_kernel_uid32_t vki_qid_t; /* Type in which we store ids in memory */
//----------------------------------------------------------------------
-// From linux-2.6.9/include/linux/ptrace.h
+// From linux-2.6.20.1/include/linux/ptrace.h
//----------------------------------------------------------------------
#define VKI_PTRACE_TRACEME 0
#define VKI_PTRACE_PEEKUSR 3
#define VKI_PTRACE_POKEUSR 6
-#define VKI_PTRACE_DETACH 0x11
+#define VKI_PTRACE_DETACH 17
+
+#define VKI_PTRACE_GETEVENTMSG 0x4201
+#define VKI_PTRACE_GETSIGINFO 0x4202
+#define VKI_PTRACE_SETSIGINFO 0x4203
//----------------------------------------------------------------------
// From linux-2.6.14/include/sound/asound.h