Commit Graph

873 Commits

Author SHA1 Message Date
Roland McGrath
5d73170df4 . 2005-06-07 23:22:26 +00:00
Roland McGrath
ca85b97c9c revert debugging code 2005-06-07 23:22:08 +00:00
Roland McGrath
76989d7a16 2005-06-06 Roland McGrath <roland@redhat.com>
* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:31 +00:00
Roland McGrath
e69b627099 2005-06-06 Roland McGrath <roland@redhat.com>
* linux/syscall.h (SYS_socket, SYS_bind, SYS_connect, SYS_listen)
	(SYS_accept, SYS_getsockname, SYS_getpeername, SYS_socketpair)
	(SYS_send, SYS_recv, SYS_sendto, SYS_recvfrom, SYS_shutdown)
	(SYS_setsockopt, SYS_getsockopt, SYS_sendmsg, SYS_recvmsg)
	(SYS_getsockname, SYS_semop, SYS_semgsub_et, SYS_semget, SYS_semctl)
	(SYS_semtimedop, SYS_msgsnd, SYS_msgrcv, SYS_msgget)
	(SYS_msgctl, SYS_shmat, SYS_shmdt, SYS_shmget)
	(SYS_shmctl): Macros renamed to SYS_sub_*.
	* syscall.c (dumpio): Match SYS_sub_* if defined instead of SYS_*.
	* linux/syscall.h (SYS_waitid): Define if not defined.
	* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:28 +00:00
Roland McGrath
173527948f 2005-06-06 Roland McGrath <roland@redhat.com>
* linux/syscall.h (SYS_socket, SYS_bind, SYS_connect, SYS_listen)
	(SYS_accept, SYS_getsockname, SYS_getpeername, SYS_socketpair)
	(SYS_send, SYS_recv, SYS_sendto, SYS_recvfrom, SYS_shutdown)
	(SYS_setsockopt, SYS_getsockopt, SYS_sendmsg, SYS_recvmsg)
	(SYS_getsockname, SYS_semop, SYS_semgsub_et, SYS_semget, SYS_semctl)
	(SYS_semtimedop, SYS_msgsnd, SYS_msgrcv, SYS_msgget)
	(SYS_msgctl, SYS_shmat, SYS_shmdt, SYS_shmget)
	(SYS_shmctl): Macros renamed to SYS_sub_*.
	* syscall.c (dumpio): Match SYS_sub_* if defined instead of SYS_*.
	* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:26 +00:00
Roland McGrath
ef78250d79 2005-06-06 Roland McGrath <roland@redhat.com>
* linux/syscallent.h: Fix pread/pwrite names to pread64/pwrite64.
	* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:24 +00:00
Roland McGrath
a4f9f2da07 2005-06-06 Roland McGrath <roland@redhat.com>
* process.c (struct_user_offsets) [X86_64]: Reorder elements so
	matching works right.
	Fixes RH#159787.
	* defs.h (struct sysent): New member `native_scno'.
	(known_scno): Declare new function.
	* linux/syscallent.h: Add new final field to interesting syscalls.
	* syscall.c (known_scno): New function.
	(dumpio, internal_syscall, syscall_fixup, trace_syscall): Use it.
	* process.c (internal_fork, internal_exit): Likewise.
	[IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Likewise.
	* strace.c (proc_open): Likewise.
	* util.c [LINUX] (setbpt): Likewise.
	* linux/syscall.h: Remove [!defined(X86_64)] from conditional
	for defining SYS_socket_subcall et al.
	* linux/syscallent.h: Likewise for #error check.
	* syscall.c (trace_syscall): Likewise for SYS_{socketcall,ipc} cases.
	Fixes RH#158934.
2005-06-07 23:21:20 +00:00
Roland McGrath
6286f66d7a . 2005-06-03 02:40:43 +00:00
Roland McGrath
0873843a24 2005-06-02 Roland McGrath <roland@redhat.com>
* file.c (printstatfs64): Cast values to unsigned long long and use
	%llu formats.
	Fixes RH#158243.
2005-06-03 02:40:39 +00:00
Roland McGrath
712a6bfb58 . 2005-06-01 19:22:30 +00:00
Roland McGrath
aa524c88c4 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
Deal with memory management issues.
	* defs.h (tprint_iov): Update prototype.
	* desc.c (sys_epoll_wait) [HAVE_SYS_EPOLL_H]: Do not allocate
	epoll_event array of arbitrary size on the stack, to avoid
	stack overflow.
	* file.c (print_xattr_val): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.
	* io.c (tprint_iov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Change iovec array handling to avoid heap memory allocation.
	* mem.c (get_nodes) [LINUX]: Check for integer overflow during
	size calculation and do not allocate array of arbitrary size on
	the stack, to avoid stack overflow.
	* net.c (printcmsghdr) [HAVE_SENDMSG]: Do not allocate array of
	arbitrary size on the stack, to avoid stack overflow.  Do not
	trust cmsg.cmsg_len to avoid read beyond the end of allocated
	object.
	(printmsghdr) [HAVE_SENDMSG]: Update tprint_iov() usage.
	* process.c (sys_setgroups): Check for integer overflow during
	malloc size calculation, to avoid heap corruption.  Change gid_t
	array handling to avoid heap memory allocation.
	(sys_getgroups): Likewise.
	(sys_setgroups32) [LINUX]: Likewise.
	(sys_getgroups32) [LINUX]: Likewise.
	* stream.c (sys_poll) [HAVE_SYS_POLL_H]: Check for integer
	overflow during malloc size calculation, to avoid heap corruption.
	Change pollfd array handling to avoid heap memory allocation.
	* system.c (sys_sysctl) [LINUX]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	* util.c (dumpiov) [HAVE_SYS_UIO_H]: Check for integer overflow
	during malloc size calculation, to avoid heap corruption.
	Fixes RH#159196.
2005-06-01 19:22:06 +00:00
Roland McGrath
b422e0d47d . 2005-06-01 19:03:30 +00:00
Roland McGrath
b2dee13345 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* util.c (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument, "const char *", with similar
	meaning to the third argument of printxval().
	* defs.h (printxval): Change third argument from "char *" to
	"const char *".
	(printflags): Add third argument.
	* bjm.c (sys_query_module) [LINUX]: Pass third argument to
	printflags().
	* desc.c (sys_fcntl): Likewise.
	(sys_flock) [LOCK_SH]: Likewise.
	(print_epoll_event) [HAVE_SYS_EPOLL_H]: Likewise.
	* file.c (sys_open): Likewise.
	(solaris_open) [LINUXSPARC]: Likewise.
	(sys_access): Likewise.
	(sys_chflags, sys_fchflags) [FREEBSD]: Likewise.
	(realprintstat) [HAVE_LONG_LONG_OFF_T &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(printstat64) [HAVE_STAT64 &&
	HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
	(sys_setxattr, sys_fsetxattr): Likewise.
	* ipc.c (sys_msgget, sys_msgsnd, sys_msgrcv, sys_semget,
	sys_shmget, sys_shmat) [LINUX || SUNOS4 || FREEBSD]: Likewise.
	(sys_mq_open) [LINUX]: Likewise.
	(printmqattr) [HAVE_MQUEUE_H]: Likewise.
	* mem.c (print_mmap) [!HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mmap64) [_LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T]: Likewise.
	(sys_mprotect): Likewise.
	(sys_mremap, sys_madvise, sys_mlockall) [LINUX]: Likewise.
	(sys_msync) [MS_ASYNC]: Likewise.
	(sys_mctl) [MC_SYNC]: Likewise.
	(sys_remap_file_pages, sys_mbind, sys_get_mempolicy) [LINUX]:
	Likewise.
	* net.c (printmsghdr) [HAVE_STRUCT_MSGHDR_MSG_CONTROL]: Likewise.
	(sys_send, sys_sendto): Likewise.
	(sys_sendmsg) [HAVE_SENDMSG]: Likewise.
	(sys_recv, sys_recvfrom): Likewise.
	(sys_recvmsg) [HAVE_SENDMSG]: Likewise.
	(printicmpfilter) [ICMP_FILTER]: Likewise.
	* proc.c (proc_ioctl) [SVR4 && !HAVE_MP_PROCFS || FREEBSD]: Likewise.
	* process.c (sys_clone) [LINUX]: Likewise.
	(printwaitn): Likewise.
	(sys_waitid) [SVR4 || LINUX]: Likewise.
	* signal.c (sys_sigvec) [SUNOS4 || FREEBSD]: Likewise.
	(sys_sigaction): Likewise.
	(printcontext) [SVR4]: Likewise.
	(print_stack_t) [LINUX) || FREEBSD]: Likewise.
	(sys_rt_sigaction) [LINUX]: Likewise.
	* sock.c (sock_ioctl) [LINUX]: Likewise.
	* stream.c (sys_putmsg, sys_getmsg): Likewise.
	(sys_putpmsg) [SYS_putpmsg]: Likewise.
	(sys_getpmsg) [SYS_getpmsg]: Likewise.
	(sys_poll): Likewise.
	(print_transport_message) [TI_BIND]: Likewise.
	(stream_ioctl): Likewise.
	* system.c (sys_mount, sys_reboot): Likewise.
	(sys_cacheflush) [LINUX && M68K]: Likewise.
	(sys_capget, sys_capset) [SYS_capget]: Likewise.
	* term.c (term_ioctl) [TIOCMGET]: Likewise.
	* time.c (sys_clock_nanosleep, sys_timer_settime) [LINUX]:
	Likewise.
	Fixes RH#159310.
2005-06-01 19:02:36 +00:00
Roland McGrath
a6ef1a3075 . 2005-06-01 18:57:27 +00:00
Roland McGrath
0d3f645a48 2005-05-22 Dmitry V. Levin <ldv@altlinux.org>
* bjm.c [LINUX]: Do not include <linux/linkage.h>.  It is not
	safe to include kernel headers, and this one is not used anyway.
	Fixes RH#158488.
2005-06-01 18:56:56 +00:00
Roland McGrath
e8c6eec04b . 2005-06-01 18:56:03 +00:00
Roland McGrath
46100d0725 2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* bjm.c (sys_query_module) [LINUX]: Unitize "out of memory"
	errors reporting style.
	* strace.c (rebuild_pollv) [USE_PROCFS]: Likewise.
	* system.c (sys_capget, sys_capset) [SYS_capget]: Likewise.
	* util.c (printstr): Likewise.
	(dumpiov) [HAVE_SYS_UIO_H]: Likewise.
	(fixvfork) [SUNOS4]: Likewise.
	* desc.c (decode_select): Continue to decode syscall arguments
	in case of OOM condition.
	* file.c (sys_getdents): Likewise.
	(sys_getdents64) [_LFS64_LARGEFILE]: Likewise.
	(sys_getdirentries) [FREEBSD]: Likewise.
	* mem.c (sys_mincore): Changed type of variables which deal with
	malloc size from int to unsigned long.
	Fixes RH#159308.
2005-06-01 18:55:42 +00:00
Roland McGrath
e776e3e4cb . 2005-05-26 23:21:13 +00:00
Roland McGrath
2cbe44e441 2005-05-26 Roland McGrath <roland@redhat.com>
* system.c (sys_sysctl): Check for errors accessing user pointers.
	Use malloc instead of alloca in case size is insane.
2005-05-26 23:21:09 +00:00
Roland McGrath
682291ec61 . 2005-05-09 08:03:06 +00:00
Roland McGrath
cbdbcafd4c 2005-05-09 Roland McGrath <roland@redhat.com>
* configure.ac: Check for libaio.h.
	* desc.c (sys_io_setup, sys_io_submit, sys_io_cancel,
	sys_io_getevents, sys_io_destroy): New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Use those for io_* syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	From Zach Brown <zach.brown@oracle.com>.
	Fixes RH#155065.
2005-05-09 08:02:31 +00:00
Roland McGrath
37b9f8480c 2005-05-09 Roland McGrath <roland@redhat.com>
* desc.c (sys_io_setup, sys_io_submit, sys_io_cancel,
	sys_io_getevents, sys_io_destroy): New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Use those for io_* syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	From Zach Brown <zach.brown@oracle.com>.
	Fixes RH#155065.
2005-05-09 08:02:00 +00:00
Roland McGrath
bc718ed396 2005-05-09 Roland McGrath <roland@redhat.com>
* debian/control (Architecture): Add ppc64.
	Fixes Debian bug #301089.
2005-05-09 08:01:36 +00:00
Roland McGrath
05a017be6b . 2005-05-09 07:46:07 +00:00
Roland McGrath
dccec72a72 2005-05-09 Roland McGrath <roland@redhat.com>
* strace.c (main): Refuse negative -s argument value.
	Fixes Debian bug #303256.
2005-05-09 07:45:47 +00:00
Roland McGrath
f04bb48240 2005-05-05 Anton Blanchard <anton@samba.org>
* process.c (ptrace_cmds): Add PTRACE_GETVRREGS and PTRACE_SETVRREGS
	if defined.
2005-05-09 07:45:33 +00:00
Roland McGrath
f3b565be86 . 2005-05-09 07:40:41 +00:00
Roland McGrath
1025c3ed7f 2005-04-25 Anton Blanchard <anton@samba.org>
* file.c (openmodes): Add O_NOATIME flag if defined.
2005-05-09 07:40:35 +00:00
Roland McGrath
802b8f41dc 2005-04-05 Anton Blanchard <anton@samba.org>
* ipc.c (shm_resource_flags): New variable, table has SHM_HUGETLB
	but not IPC_NOWAIT, which have the same value.
	(sys_shmget): Use that instead of resource_flags.
2005-05-09 07:40:33 +00:00
Roland McGrath
ad81dce78f 2005-04-05 Anton Blanchard <anton@samba.org>
* signal.c (signame): Don't try and dereference negative index.
2005-05-09 07:40:30 +00:00
Roland McGrath
039a00aa83 2005-04-05 Anton Blanchard <anton@samba.org>
* linux/powerpc/syscallent.h: Add debug_setcontext, vserver,
	mbind, *_mempolicy, mq_*, sys_kexec_load, add_key, request_key,
	keyctl, waitid, sys_semtimedop.  Fix various other syscalls.
2005-05-09 07:40:27 +00:00
Roland McGrath
cd71177823 2005-04-05 Anton Blanchard <anton@samba.org>
* linux/powerpc/ioctlent.h: Regenerated.
2005-05-09 07:40:25 +00:00
Roland McGrath
e1f1e57443 . 2005-03-23 03:19:02 +00:00
Roland McGrath
183df961ee 2005-03-22 Roland McGrath <roland@redhat.com>
* desc.c (decode_select): Increase local buffer size.
	Fixes RH#151570.
2005-03-23 03:18:59 +00:00
Roland McGrath
a3734a91ed . 2005-03-22 23:13:24 +00:00
Roland McGrath
985e8fd9bd 2005-03-22 Roland McGrath <roland@redhat.com>
* linux/arm/syscallent.h: Fix 113 entry (syscall, not vm86old).
2005-03-22 23:12:41 +00:00
Roland McGrath
7147a3df2c 2005-03-22 Roland McGrath <roland@redhat.com>
* configure.ac, NEWS: Version 4.5.11.
	* debian/changelog, strace.spec: 4.5.11-1.
2005-03-22 23:12:39 +00:00
Roland McGrath
3181c51d47 . 2005-03-15 02:40:23 +00:00
Roland McGrath
d8184030b3 2005-03-14 Roland McGrath <roland@redhat.com>
* configure.ac, NEWS: Version 4.5.10.
	* debian/changelog, strace.spec: 4.5.10-1.
2005-03-15 02:40:12 +00:00
Roland McGrath
0495c93dee . 2005-03-15 02:17:23 +00:00
Roland McGrath
0de75164d8 2005-02-26 GOTO Masanori <gotom@debian.or.jp>
* linux/alpha/syscallent.h: Fix the reversed order of lstat64 and
	fstat64.  Clean up osf_nrecvmsg and osf_ngetsockname.
2005-03-15 02:17:10 +00:00
Roland McGrath
391a4e7bc2 . 2005-03-15 02:16:21 +00:00
Roland McGrath
eca2025d6d 2005-03-14 Roland McGrath <roland@redhat.com>
* linux/mips/syscallent.h: Update various calls.
	From Thiemo Seufer <ths@networkno.de>.
	Fixes Debian bug #256684.
2005-03-15 02:16:05 +00:00
Roland McGrath
14b082ed7c 2005-03-14 Roland McGrath <roland@redhat.com>
* debian/control (Architecture): Add s390.
	Fixes Debian bug #294172.
2005-03-15 02:15:54 +00:00
Roland McGrath
920e6bb712 2005-02-28 Andreas Schwab <schwab@suse.de>
* syscall.c (getrval2): Move #ifdef IA64 inside #ifdef LINUX.
2005-03-15 02:15:20 +00:00
Roland McGrath
bfb49e5f60 . 2005-03-06 22:24:52 +00:00
Roland McGrath
3a055d7d64 2005-03-06 Roland McGrath <roland@redhat.com>
* strace.c (trace) [PTRACE_GETSIGINFO]: Fetch siginfo_t for SIGSEGV
	and SIGBUS signals, use si_addr in output.
2005-03-06 22:24:29 +00:00
Roland McGrath
4859f6cef8 . 2005-03-01 23:03:11 +00:00
Roland McGrath
f774642aa4 2005-03-01 Roland McGrath <roland@redhat.com>
* file.c (print_xattr_val): Add a cast.
2005-03-01 23:02:32 +00:00
Roland McGrath
b0a3d4ee5a . 2005-02-06 01:55:16 +00:00