PRINT("personality ( %d )", arg1);
}
-PRE(chroot)
+PREx(sys_chroot, 0)
{
- /* int chroot(const char *path); */
- PRINT("chroot ( %p )", arg1);
+ PRINT("sys_chroot ( %p )", arg1);
+ PRE_REG_READ1(long, "chroot", const char *, path);
PRE_MEM_RASCIIZ( "chroot(path)", arg1 );
}
}
}
-PRE(dup2)
+PREx(sys_dup2, 0)
{
- /* int dup2(int oldfd, int newfd); */
- PRINT("dup2 ( %d, %d )", arg1,arg2);
+ PRINT("sys_dup2 ( %d, %d )", arg1,arg2);
+ PRE_REG_READ2(long, "dup2", unsigned int, oldfd, unsigned int, newfd);
if (!fd_allowed(arg2, "dup2", tid, True))
set_result( -VKI_EBADF );
}
-POST(dup2)
+POST(sys_dup2)
{
- if(VG_(clo_track_fds))
+ if (VG_(clo_track_fds))
record_fd_open(tid, res, VG_(resolve_filename)(res));
}
POST_MEM_WRITE( arg2, sizeof(vki_stack_t));
}
-PRE(sigaction)
+// XXX: x86-specific
+PREx(sys_sigaction, SIG_SIM)
{
- /* int sigaction(int signum, struct k_sigaction *act,
- struct k_sigaction *oldact); */
- PRINT("sigaction ( %d, %p, %p )",arg1,arg2,arg3);
+ PRINT("sys_sigaction ( %d, %p, %p )", arg1,arg2,arg3);
+ PRE_REG_READ3(int, "sigaction",
+ int, signum, const struct old_sigaction *, act,
+ struct old_sigaction *, oldact)
if (arg2 != (UWord)NULL)
PRE_MEM_READ( "sigaction(act)", arg2, sizeof(struct vki_sigaction));
if (arg3 != (UWord)NULL)
VG_(do_sys_sigaction)(tid);
}
-POST(sigaction)
+POST(sys_sigaction)
{
if (res == 0 && arg3 != (UWord)NULL)
POST_MEM_WRITE( arg3, sizeof(struct vki_sigaction));
}
-PREALIAS(rt_sigaction, sigaction);
-POSTALIAS(rt_sigaction, sigaction);
+PREALIAS(rt_sigaction, sys_sigaction);
+POSTALIAS(rt_sigaction, sys_sigaction);
PRE(sigprocmask)
{
// (__NR_oldolduname, sys_olduname), // 59 (?) L -- obsolete
SYSX_(__NR_umask, sys_umask), // 60 * P
- SYSB_(chroot, 0), // 61 sys_chroot *
- // (__NR_ustat, sys_ustat) // 62 * (SVr4, deprecated)
- SYSBA(dup2, 0), // 63 sys_dup2 *
- SYSX_(__NR_getppid, sys_getppid), // 64 *
-
- SYSX_(__NR_getpgrp, sys_getpgrp), // 65 *
- SYSX_(__NR_setsid, sys_setsid), // 66 *
- SYSBA(sigaction, SIG_SIM), // 67 sys_sigaction
+ SYSX_(__NR_chroot, sys_chroot), // 61 * (almost P)
+ // (__NR_ustat, sys_ustat) // 62 * (SVr4) -- deprecated
+ SYSXY(__NR_dup2, sys_dup2), // 63 * P
+ SYSX_(__NR_getppid, sys_getppid), // 64 * P
+
+ SYSX_(__NR_getpgrp, sys_getpgrp), // 65 * P
+ SYSX_(__NR_setsid, sys_setsid), // 66 * P
+ SYSXY(__NR_sigaction, sys_sigaction), // 67 (x86) P
// (__NR_sgetmask, sys_sgetmask), // 68 * (ANSI C)
// (__NR_ssetmask, sys_ssetmask), // 69 * (ANSI C)
SY(__NR_umask, x0);
// __NR_chroot 61
+ GO(__NR_chroot, "1s 1m");
+ SY(__NR_chroot, x0);
+
// __NR_ustat 62
+ // (deprecated, not handled by Valgrind)
+
// __NR_dup2 63
+ GO(__NR_dup2, "2s 0m");
+ SY(__NR_dup2, x0, x0);
// __NR_getppid 64 --> sys_getppid()
GO(__NR_getppid, "0e");
SY(__NR_setsid);
// __NR_sigaction 67
+ GO(__NR_sigaction, "3s 2m");
+ SY(__NR_sigaction, x0, x0+1, x0+1);
+
// __NR_sgetmask 68
+ // (Not yet handled by Valgrind)
+
// __NR_ssetmask 69
+ // (Not yet handled by Valgrind)
+
// __NR_setreuid 70
// __NR_setregid 71
// __NR_sigsuspend 72
// __NR_sigpending 73
+
// __NR_sethostname 74
+ // (Not yet handled by Valgrind)
+
// __NR_setrlimit 75
// __NR_getrlimit 76
// __NR_getrusage 77
// (obsolete, not handled by Valgrind)
// __NR_readlink 85
+
// __NR_uselib 86
+ // (Not yet handled by Valgrind)
+
// __NR_swapon 87
+ // (Not yet handled by Valgrind)
+
// __NR_reboot 88
+ // (Not yet handled by Valgrind)
+
// __NR_readdir 89
+ // (superseded, not handled by Valgrind)
+
// __NR_mmap 90
// __NR_munmap 91
// __NR_truncate 92
at 0x........: syscall (in /...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
+-----------------------------------------------------
+ 61: __NR_chroot 1s 1m
+-----------------------------------------------------
+
+Syscall param chroot(path) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param chroot(path) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+ 63: __NR_dup2 2s 0m
+-----------------------------------------------------
+
+Syscall param dup2(oldfd) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param dup2(newfd) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
-----------------------------------------------------
64: __NR_getppid 0e
-----------------------------------------------------
-----------------------------------------------------
66: __NR_setsid 0e
-----------------------------------------------------
+-----------------------------------------------------
+ 67: __NR_sigaction 3s 2m
+-----------------------------------------------------
+
+Syscall param sigaction(signum) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param sigaction(act) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param sigaction(oldact) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param sigaction(act) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Syscall param sigaction(oldact) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
111: __NR_vhangup 0e
-----------------------------------------------------