]> granicus.if.org Git - strace/log
strace
7 years agoFix decoding of sethostname syscall
Dmitry V. Levin [Sat, 24 Dec 2016 16:23:45 +0000 (16:23 +0000)]
Fix decoding of sethostname syscall

The second argument of sethostname syscall is not an unsigned long but
unsigned int.  The kernel does not look at the string argument when
the length argument is too long.

* hostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
[!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
(SYS_FUNC(sethostname)): Treat the second argument as unsigned int.
Print the first argument as a pointer when the second argument exceeds
__NEW_UTS_LEN.
* tests/sethostname.c [HAVE_LINUX_UTSNAME_H]: Include <linux/utsname.h>.
[!__NEW_UTS_LEN] (__NEW_UTS_LEN): Define.
(main): Use it.  Check that the second argument of sethostname
is handled as unsigned int.  Check that the first argument is printed
as a pointer when the second argument exceeds __NEW_UTS_LEN.

7 years agotests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h
Dmitry V. Levin [Fri, 23 Dec 2016 18:44:37 +0000 (18:44 +0000)]
tests: add F8ILL_KULONG_* and f8ill_ptr_to_kulong to tests.h

* tests/tests.h (F8ILL_KULONG_SUPPORTED, F8ILL_KULONG_MASK): New macros.
(f8ill_ptr_to_kulong): New static inline function.

7 years agoprintstr: rename to printstrn, add printstr as a thin wrapper
Dmitry V. Levin [Tue, 20 Dec 2016 16:43:26 +0000 (16:43 +0000)]
printstr: rename to printstrn, add printstr as a thin wrapper

As about half of all printstr uses cases are invocations with the last
argument set to -1, create a dedicated function for this use case.

* defs.h (printstr): Rename to printstrn.  All callers updated.
(printstr): New static inline function.  All callers updated.

7 years agoprocess: change ptrace arguments type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 23:08:45 +0000 (23:08 +0000)]
process: change ptrace arguments type from unsigned long to kernel_ureg_t

(SYS_FUNC(ptrace)): Change type of request and data arguments
from unsigned long to kernel_ureg_t.

7 years agoprocess: change tracee address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 23:02:21 +0000 (23:02 +0000)]
process: change tracee address type from unsigned long to kernel_ureg_t

* process.c (print_user_offset_addr): Change address argument type
from unsigned long to kernel_ureg_t.
(SYS_FUNC(ptrace)): Change addr variable type from unsigned long
to kernel_ureg_t.

7 years agonet: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 10:50:10 +0000 (10:50 +0000)]
net: change address argument type from long to kernel_ureg_t

* net.c (decode_sockbuf, decode_pair_fd, print_linger, print_ucred,
print_tpacket_stats, print_icmp_filter, print_getsockopt, print_mreq,
print_mreq6, print_group_req, print_tpacket_req, print_packet_mreq,
print_setsockopt): Change address argument type from long
to kernel_ureg_t.

7 years agoprint_mq_attr: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 01:21:34 +0000 (01:21 +0000)]
print_mq_attr: change address argument type from long to kernel_ureg_t

* print_mq_attr.c (printmqattr): Change address argument type from long
to kernel_ureg_t.

7 years agoipc_*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 01:05:06 +0000 (01:05 +0000)]
ipc_*: change address argument type from long to kernel_ureg_t

* ipc_msg.c (tprint_msgsnd, tprint_msgrcv, fetch_msgrcv_args): Change
address argument type from long to kernel_ureg_t.
* ipc_msgctl.c (print_msqid_ds): Likewise.
* ipc_sem.c (tprint_sembuf_array): Likewise.
* ipc_shmctl.c (print_shmid_ds): Likewise.

7 years agoprint_msgbuf: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 00:55:57 +0000 (00:55 +0000)]
print_msgbuf: change address argument type from long to kernel_ureg_t

* print_msgbuf.c (tprint_msgbuf): Change address argument type
from long to kernel_ureg_t.

7 years agodesc: change tracee address type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 23:23:55 +0000 (23:23 +0000)]
desc: change tracee address type from long to kernel_ureg_t

* desc.c (decode_select): Rename arg to addr, change its type
from long to kernel_ureg_t.

7 years agouid: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:52:39 +0000 (20:52 +0000)]
uid: change address argument type from long to kernel_ureg_t

* uid.c (get_print_uid): Change address argument type
from long to kernel_ureg_t.

7 years agotime: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:51:33 +0000 (20:51 +0000)]
time: change address argument type from long to kernel_ureg_t

* time.c (print_timezone, do_adjtimex): Change address argument type
from long to kernel_ureg_t.

7 years agosched: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:47:39 +0000 (20:47 +0000)]
sched: change address argument type from long to kernel_ureg_t

* sched.c (print_sched_attr): Change address argument type
from long to kernel_ureg_t.

7 years agoprintsiginfo: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:44:06 +0000 (20:44 +0000)]
printsiginfo: change address argument type from long to kernel_ureg_t

* printsiginfo.c (printsiginfo_at): Change address argument type
from long to kernel_ureg_t.

7 years agoprint_timex: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:42:50 +0000 (20:42 +0000)]
print_timex: change address argument type from long to kernel_ureg_t

* print_timex.c (print_timex): Change address argument type
from long to kernel_ureg_t.

7 years agoprint_sigevent: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 17:11:53 +0000 (17:11 +0000)]
print_sigevent: change address argument type from long to kernel_ureg_t

* print_sigevent.c (print_sigevent): Change address argument type
from long to kernel_ureg_t.

7 years agopoll: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 16:56:14 +0000 (16:56 +0000)]
poll: change address argument type from long to kernel_ureg_t

* poll.c (decode_poll_exiting): Change tracee address argument type
from long to kernel_ureg_t.

7 years agoprintrusage*: change tracee address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 00:54:18 +0000 (00:54 +0000)]
printrusage*: change tracee address argument type from long to kernel_ureg_t

* defs.h [ALPHA] (printrusage32): Change address argument type
from long to kernel_ureg_t.
* printrusage.c (printrusage): Likewise.
[ALPHA] (printrusage32): Likewise.
* wait.c (printwaitn): Change the type of tracee address argument
of print_rusage from long to kernel_ureg_t.

7 years agoprint_time*: change tracee address argument type from long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 00:37:28 +0000 (00:37 +0000)]
print_time*: change tracee address argument type from long to kernel_ureg_t

* defs.h [ALPHA] (sprint_timeval32, print_timeval32,
print_timeval32_pair, print_itimerval32): Change address argument type
from long to kernel_ureg_t.
* desc.c (decode_select): Change the type of tracee address argument
of print_tv_ts and sprint_tv_ts from long to kernel_ureg_t.
* print_timespec.c (print_timespec, sprint_timespec,
print_timespec_utime_pair, print_itimerspec): Change address argument
type from long to kernel_ureg_t.
* print_timeval.c (print_timeval, print_timeval_pair, sprint_timeval,
print_itimerval, print_timeval32, print_timeval32_pair,
print_itimerval32, sprint_timeval32): Likewise.

7 years agortc: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 13:23:35 +0000 (13:23 +0000)]
rtc: change type of ioctl 3rd argument from long to kernel_ureg_t

* rtc.c (decode_rtc_time, decode_rtc_wkalrm, decode_rtc_pll_info):
Change addr type from long to kernel_ureg_t.
(rtc_ioctl): Change arg type from long to kernel_ureg_t.

7 years agomtd: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 13:19:48 +0000 (13:19 +0000)]
mtd: change type of ioctl 3rd argument from long to kernel_ureg_t

* mtd.c (decode_erase_info_user, decode_erase_info_user64,
decode_mtd_oob_buf, decode_mtd_oob_buf64, decode_otp_info,
decode_otp_select, decode_mtd_write_req, decode_mtd_info_user,
decode_nand_oobinfo, decode_nand_ecclayout_user, decode_mtd_ecc_stats):
Change addr type from long to kernel_ureg_t.
(mtd_ioctl): Change arg type from long to kernel_ureg_t.

7 years agohdio: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 13:18:12 +0000 (13:18 +0000)]
hdio: change type of ioctl 3rd argument from long to kernel_ureg_t

* hdio.c (hdio_ioctl): Change arg type from long to kernel_ureg_t.

7 years agov4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 01:22:18 +0000 (01:22 +0000)]
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t

* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.

7 years agoevdev: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
evdev: change type of ioctl 3rd argument from long to kernel_ureg_t

* evdev.c (ff_effect_ioctl, abs_ioctl, keycode_ioctl, keycode_V2_ioctl,
getid_ioctl, decode_bitset, mtslots_ioctl, repeat_ioctl, bit_ioctl,
evdev_read_ioctl, evdev_write_ioctl, evdev_ioctl): Change arg type
from long to kernel_ureg_t.

7 years agobtrfs: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
btrfs: change type of ioctl 3rd argument from long to kernel_ureg_t

* btrfs.c (btrfs_print_balance, btrfs_ioctl): Change arg type from long
to kernel_ureg_t.

7 years agoblock: change type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
block: change type of ioctl 3rd argument from long to kernel_ureg_t

* block.c (block_ioctl): Change arg type from long to kernel_ureg_t.

7 years agoChange type of ioctl 3rd argument from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
Change type of ioctl 3rd argument from long to kernel_ureg_t

* defs.h (DECL_IOCTL): Change arg type from long to kernel_ureg_t.
* dm.c (dm_known_ioctl, dm_ioctl): Likewise.
* file_ioctl.c (file_ioctl): Likewise.
* fs_x_ioctl.c (fs_x_ioctl): Likewise.
* ioctl.c (ioctl_decode): Likewise.
* loop.c (decode_loop_info, decode_loop_info64): Change addr type
from long to kernel_ureg_t.
(loop_ioctl): Change arg type from long to kernel_ureg_t.
* ptp.c (ptp_ioctl): Likewise.
* scsi.c (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req,
print_sg_io_v4_res, scsi_ioctl): Likewise.
* sock.c (print_ifreq, sock_ioctl): Likewise.
(decode_ifconf): Change addr type from long to kernel_ureg_t.
* term.c (decode_termios, decode_termio, decode_winsize, decode_ttysize,
decode_modem_flags): Likewise.
(term_ioctl): Change arg type from long to kernel_ureg_t.
* ubi.c (ubi_ioctl): Likewise.
* userfaultfd.c (uffdio_ioctl): Likewise.

7 years agoldt: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 18:21:26 +0000 (18:21 +0000)]
ldt: change address argument type from long to kernel_ureg_t

* defs.h [HAVE_STRUCT_USER_DESC] (print_user_desc): Change address
argument type from long to kernel_ureg_t.
* ldt.c [HAVE_STRUCT_USER_DESC] (print_user_desc): Likewise.

7 years agofcntl: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:13:18 +0000 (21:13 +0000)]
fcntl: change address argument type from long to kernel_ureg_t

* fcntl.c (printflock64, printflock, print_f_owner_ex): Change
address argument type from long to kernel_ureg_t.

7 years agoexecve: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:06:58 +0000 (21:06 +0000)]
execve: change address argument type from long to kernel_ureg_t

* execve.c (printargv, printargc): Change address argument type
from long to kernel_ureg_t.

7 years agodirent: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:05:23 +0000 (21:05 +0000)]
dirent: change address argument type from long to kernel_ureg_t

* dirent.c (print_old_dirent): Change address argument type from long
to kernel_ureg_t.

7 years agobpf: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 02:43:47 +0000 (02:43 +0000)]
bpf: change address argument type from long to kernel_ureg_t

* bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem,
bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument
type from long to kernel_ureg_t.

7 years agodump*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
dump*: change address argument type from long to kernel_ureg_t

* defs.h (dumpiov_in_msghdr, dumpiov_in_mmsghdr, dumpiov_upto, dumpstr):
Change address argument type from long to kernel_ureg_t.
* mmsghdr.c (dumpiov_in_mmsghdr): Likewise.
* msghdr.c (fetch_msghdr_namelen, decode_msghdr, dumpiov_in_msghdr):
Likewise.
* util.c (dumpiov_upto, dumpstr): Likewise.

7 years agoprint_sigset_addr_len: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 23:30:54 +0000 (23:30 +0000)]
print_sigset_addr_len: change address argument type from long to kernel_ureg_t

* defs.h (print_sigset_addr_len) Change address argument type from long
to kernel_ureg_t.
* signal.c (print_sigset_addr_len_limit, print_sigset_addr_len,
decode_old_sigaction, decode_new_sigaction): Likewise.

7 years agodecode_sockaddr: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 23:22:21 +0000 (23:22 +0000)]
decode_sockaddr: change address argument type from long to kernel_ureg_t

* defs.h (decode_sockaddr) Change tracee address argument type from long
to kernel_ureg_t.
* sockaddr.c (decode_sockaddr): Likewise.

7 years agoprint_struct_statfs*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 23:07:13 +0000 (23:07 +0000)]
print_struct_statfs*: change address argument type from long to kernel_ureg_t

* defs.h (print_struct_statfs, print_struct_statfs64): Change address
argument type from long to kernel_ureg_t.
* print_statfs.c (print_struct_statfs, print_struct_statfs64): Likewise.
* fetch_struct_statfs.c (fetch_struct_statfs, fetch_struct_statfs64):
Likewise.

7 years agofetch_struct_flock: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:15:59 +0000 (21:15 +0000)]
fetch_struct_flock: change address argument type from long to kernel_ureg_t

* fetch_struct_flock.c (fetch_struct_flock, fetch_struct_flock64):
Change address argument type from long to kernel_ureg_t.

7 years agofetch_seccomp_fprog: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:29:21 +0000 (15:29 +0000)]
fetch_seccomp_fprog: change address argument type from long to kernel_ureg_t

* fetch_seccomp_fprog.c (fetch_seccomp_fprog): Change address argument
type from long to kernel_ureg_t.

7 years agoprintnum_*, printpair_*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 22:33:52 +0000 (22:33 +0000)]
printnum_*, printpair_*: change address argument type from long to kernel_ureg_t

* defs.h (DECL_PRINTNUM, DECL_PRINTPAIR, printnum_long_int): Change
address argument type from long to kernel_ureg_t.
* util.c (DEF_PRINTNUM, DEF_PRINTPAIR, printnum_long_int): Likewise.

7 years agoprintpath*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 22:06:34 +0000 (22:06 +0000)]
printpath*: change address argument type from long to kernel_ureg_t

* defs.h (printpath, printpathn): Change address argument type
from long to kernel_ureg_t.
* util.c (printpath, printpathn): Likewise.

7 years agoprintstr*: change address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 21:59:24 +0000 (21:59 +0000)]
printstr*: change address argument type from long to kernel_ureg_t

* defs.h (printstr_ex, printstr_ex): Change address argument type
from long to kernel_ureg_t.
* util.c (printstr_ex): Likewise.

7 years agoumove*: change tracee address argument type from long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 21:23:39 +0000 (21:23 +0000)]
umove*: change tracee address argument type from long to kernel_ureg_t

* defs.h (umovestr, umoven, umoven_or_printaddr,
umoven_or_printaddr_ignore_syserror): Change tracee address argument
type from long to kernel_ureg_t.
(print_array): Change the type of tracee address argument of umoven_func
from long to kernel_ureg_t.
* util.c (vm_read_mem, umovestr, umoven, umoven_or_printaddr,
umoven_or_printaddr_ignore_syserror): Change tracee address argument
type from long to kernel_ureg_t.
(print_array): Change the type of tracee address argument of umoven_func
from long to kernel_ureg_t.
* desc.c (umove_kulong_array_or_printaddr): Change tracee address
argument type from long to kernel_ureg_t.
* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Likewise.

7 years agofutex: change address type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:33:03 +0000 (21:33 +0000)]
futex: change address type from long to kernel_ureg_t

* futex.c (SYS_FUNC(futex)): Change address type from long
to kernel_ureg_t.

7 years agofile_handle: change address type from long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:29:38 +0000 (21:29 +0000)]
file_handle: change address type from long to kernel_ureg_t

* file_handle.c (SYS_FUNC(name_to_handle_at),
SYS_FUNC(open_by_handle_at)): Change address type from long
to kernel_ureg_t.

7 years agoprintsiginfo: cast pointers to kernel_ureg_t instead of unsigned long
Dmitry V. Levin [Sun, 25 Dec 2016 02:49:58 +0000 (02:49 +0000)]
printsiginfo: cast pointers to kernel_ureg_t instead of unsigned long

* printsiginfo.c (printsigval): Cast siginfo.si_ptr pointer
to kernel_ureg_t instead of unsigned long.
(print_si_info): Cast siginfo.si_addr and siginfo.si_call_addr pointers
to kernel_ureg_t instead of unsigned long.

7 years agosigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long
Dmitry V. Levin [Sun, 25 Dec 2016 02:30:12 +0000 (02:30 +0000)]
sigaltstack: cast pointers and sizes to kernel_ureg_t instead of unsigned long

* sigaltstack.c (print_stack_t): Cast sigaltstack.ss_sp pointer
and sigaltstack.ss_size to kernel_ureg_t instead of unsigned long.

7 years agov4l2: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Sat, 24 Dec 2016 14:22:19 +0000 (14:22 +0000)]
v4l2: cast pointers to kernel_ureg_t instead of long

* v4l2.c (print_v4l2_ext_control): Cast v4l2_ext_control.string pointer
to kernel_ureg_t instead of long.

7 years agov4l2: cast pointers to kernel_ureg_t instead of unsigned long
Dmitry V. Levin [Sun, 25 Dec 2016 02:14:49 +0000 (02:14 +0000)]
v4l2: cast pointers to kernel_ureg_t instead of unsigned long

* v4l2.c (print_v4l2_buffer): Remove redundant cast.
(print_v4l2_framebuffer): Cast v4l2_framebuffer.base pointer
to kernel_ureg_t instead of unsigned long.
(print_v4l2_ext_controls): Cast v4l2_ext_controls.controls pointer
to kernel_ureg_t instead of unsigned long.

7 years agosysctl: cast pointers to kernel_ureg_t instead of size_t
Dmitry V. Levin [Fri, 23 Dec 2016 23:49:55 +0000 (23:49 +0000)]
sysctl: cast pointers to kernel_ureg_t instead of size_t

* sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldval and
__sysctl_args.newval pointers to kernel_ureg_t instead of size_t.

7 years agosysctl: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Fri, 23 Dec 2016 23:43:53 +0000 (23:43 +0000)]
sysctl: cast pointers to kernel_ureg_t instead of long

* sysctl.c (SYS_FUNC(sysctl)): Cast __sysctl_args.oldlenp pointer
to kernel_ureg_t instead of long.

7 years agoblock: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Wed, 21 Dec 2016 13:54:49 +0000 (13:54 +0000)]
block: cast pointers to kernel_ureg_t instead of long

* block.c (print_blkpg_req): Cast blkpg_ioctl_arg.data pointer
to kernel_ureg_t instead of long.

7 years agodumpiov_upto: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
dumpiov_upto: cast pointers to kernel_ureg_t instead of long

* util.c  (dumpiov_upto): Cast iovec.iov_base pointer to kernel_ureg_t
instead of long.

7 years agomsghdr: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
msghdr: cast pointers to kernel_ureg_t instead of long

* msghdr.c (print_struct_msghdr): Cast msghdr.msg_name pointer
to kernel_ureg_t instead of long.
(dumpiov_in_msghdr): Cast msghdr.msg_iov pointer to kernel_ureg_t
instead of long.

7 years agommsghdr: cast pointers to kernel_ureg_t instead of long
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
mmsghdr: cast pointers to kernel_ureg_t instead of long

* mmsghdr.c (dumpiov_in_mmsghdr): Cast msghdr.msg_iov pointer
to kernel_ureg_t instead of long.

7 years agoRemove redundant casts of ptrace arguments
Dmitry V. Levin [Fri, 23 Dec 2016 23:33:40 +0000 (23:33 +0000)]
Remove redundant casts of ptrace arguments

* strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument
from pointer to long type.

7 years agoptrace_restart: cleanup
Dmitry V. Levin [Fri, 23 Dec 2016 23:39:35 +0000 (23:39 +0000)]
ptrace_restart: cleanup

* strace.c (ptrace_restart): Replace the sequence of "if" statements
with a "switch" statement.

7 years agoptrace_restart: change types of integer arguments to unsigned
Dmitry V. Levin [Fri, 23 Dec 2016 23:30:33 +0000 (23:30 +0000)]
ptrace_restart: change types of integer arguments to unsigned

* strace.c (ptrace_restart): Change types of "op" and "sig"
from int to unsigned int.

7 years agoprocess: remove redundant syserror checks
Dmitry V. Levin [Fri, 23 Dec 2016 23:05:46 +0000 (23:05 +0000)]
process: remove redundant syserror checks

* process.c (SYS_FUNC(ptrace)): Remove syserror checks as both
print_siginfo_array and print_seccomp_fprog do the right thing
by using umoven_or_printaddr.

7 years agosparc64: remove redundant casts
Dmitry V. Levin [Sat, 24 Dec 2016 14:19:14 +0000 (14:19 +0000)]
sparc64: remove redundant casts

* linux/sparc64/get_syscall_args.c (get_syscall_args): Remove
redundant casts from uint32_t to long.

7 years agonuma: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 19:59:46 +0000 (19:59 +0000)]
numa: change address argument type from unsigned long to kernel_ureg_t

* numa.c (print_nodemask): Change address argument type from
unsigned long to kernel_ureg_t.

7 years agonet: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 10:47:36 +0000 (10:47 +0000)]
net: change address argument type from unsigned long to kernel_ureg_t

* net.c (fetch_socklen): Change address argument type from
unsigned long to kernel_ureg_t.

7 years agomem: change tracee address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 12:45:03 +0000 (12:45 +0000)]
mem: change tracee address type from unsigned long to kernel_ureg_t

* mem.c (print_mmap, SYS_FUNC(remap_file_pages),
SYS_FUNC(subpage_prot)): Change the type of variables containing tracee
addresses from unsigned long to kernel_ureg_t.

7 years agokexec: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Fri, 23 Dec 2016 01:18:15 +0000 (01:18 +0000)]
kexec: change address argument type from unsigned long to kernel_ureg_t

* kexec.c (print_kexec_segments): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agopoll: change counter type from unsigned long to unsigned int
Dmitry V. Levin [Thu, 22 Dec 2016 17:59:19 +0000 (17:59 +0000)]
poll: change counter type from unsigned long to unsigned int

* poll.c (decode_poll_exiting): Change the type of printed and
max_printed counters from unsigned long to unsigned int.

7 years agoxattr: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:54:10 +0000 (20:54 +0000)]
xattr: change address argument type from unsigned long to kernel_ureg_t

* xattr.c (print_xattr_val, print_xattr_list): Change address
argument type from unsigned long to kernel_ureg_t.

7 years agouid: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:53:16 +0000 (20:53 +0000)]
uid: change address argument type from unsigned long to kernel_ureg_t

* uid.c (print_groups): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agostat64: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:50:45 +0000 (20:50 +0000)]
stat64: change address argument type from unsigned long to kernel_ureg_t

* stat64.c (decode_struct_stat64): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agostat: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:50:13 +0000 (20:50 +0000)]
stat: change address argument type from unsigned long to kernel_ureg_t

* stat.c (decode_struct_stat): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agosigaltstack: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:49:04 +0000 (20:49 +0000)]
sigaltstack: change address argument type from unsigned long to kernel_ureg_t

* sigaltstack.c (print_stack_t): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agoresource: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:46:16 +0000 (20:46 +0000)]
resource: change address argument type from unsigned long to kernel_ureg_t

* resource.c (print_rlimit64, print_rlimit32, decode_rlimit): Change
address argument type from unsigned long to kernel_ureg_t.

7 years agoprintsiginfo: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 20:44:44 +0000 (20:44 +0000)]
printsiginfo: change address argument type from unsigned long to kernel_ureg_t

* printsiginfo.c (print_siginfo_array): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agopoll: change tracee address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 16:56:14 +0000 (16:56 +0000)]
poll: change tracee address type from unsigned long to kernel_ureg_t

* poll.c (decode_poll_entering, decode_poll_exiting): Change the type
all tracee address variables from unsigned long to kernel_ureg_t.

7 years agoperf: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 02:50:05 +0000 (02:50 +0000)]
perf: change address argument type from unsigned long to kernel_ureg_t

* perf.c (fetch_perf_event_attr, print_perf_event_attr): Change
address argument type from unsigned long to kernel_ureg_t.

7 years agopathtrace: change tracee address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Thu, 22 Dec 2016 02:43:57 +0000 (02:43 +0000)]
pathtrace: change tracee address type from unsigned long to kernel_ureg_t

* pathtrace.c (upathmatch): Change address argument type
from unsigned long to kernel_ureg_t.
(pathtrace_match): Change the type of all tracee address variables
from unsigned long to kernel_ureg_t.

7 years agoscsi: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
scsi: change address argument type from unsigned long to kernel_ureg_t

* scsi.c (print_sg_io_buffer): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agodm: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 03:03:09 +0000 (03:03 +0000)]
dm: change address argument type from unsigned long to kernel_ureg_t

* dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps,
dm_decode_dm_name_list, dm_decode_dm_target_versions,
dm_decode_dm_target_msg, dm_decode_string): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agooldstat: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:39:15 +0000 (21:39 +0000)]
oldstat: change address argument type from unsigned long to kernel_ureg_t

* oldstat.c (print_old_kernel_stat): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agocapability: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 17:08:17 +0000 (17:08 +0000)]
capability: change address argument type from unsigned long to kernel_ureg_t

* capability.c (get_cap_header, print_cap_header, print_cap_data):
Change address argument type from unsigned long to kernel_ureg_t.

7 years agobtrfs: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 17:00:44 +0000 (17:00 +0000)]
btrfs: change address argument type from unsigned long to kernel_ureg_t

* btrfs.c (btrfs_print_qgroup_inherit): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agoaffinity: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 02:10:53 +0000 (02:10 +0000)]
affinity: change address argument type from unsigned long to kernel_ureg_t

* affinity.c (print_affinitylist): Change address argument type from
unsigned long to kernel_ureg_t.

7 years agoaio: change address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 02:25:37 +0000 (02:25 +0000)]
aio: change address type from unsigned long to kernel_ureg_t

* aio.c (print_iocb): Remove casts to unsigned long.
(print_iocbp,  SYS_FUNC(io_submit)): Change address type
from unsigned long to kernel_ureg_t.

7 years agommsghdr: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
mmsghdr: change address argument type from unsigned long to kernel_ureg_t

* mmsghdr.c (save_mmsgvec_namelen, decode_mmsgvec): Change
address argument type from unsigned long to kernel_ureg_t.

7 years agomsghdr: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
msghdr: change address argument type from unsigned long to kernel_ureg_t

* msghdr.c (decode_msg_control): Change address argument type
from unsigned long to kernel_ureg_t.

7 years agofetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:22:25 +0000 (21:22 +0000)]
fetch_struct_stat64: change address argument type from unsigned long to kernel_ureg_t

* fetch_struct_stat64.c (fetch_struct_stat64): Change address argument
type from unsigned long to kernel_ureg_t.

7 years agofetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 21:21:20 +0000 (21:21 +0000)]
fetch_struct_stat: change address argument type from unsigned long to kernel_ureg_t

* fetch_struct_stat.c (fetch_struct_stat): Change address argument
type from unsigned long to kernel_ureg_t.

7 years agofetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
fetch_struct_msghdr: change address argument type from unsigned long to kernel_ureg_t

* fetch_struct_msghdr.c (fetch_struct_msghdr): Change
address argument type from unsigned long to kernel_ureg_t.

7 years agofetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Wed, 21 Dec 2016 15:36:50 +0000 (15:36 +0000)]
fetch_struct_mmsghdr: change address argument type from unsigned long to kernel_ureg_t

* fetch_struct_mmsghdr.c (fetch_struct_mmsghdr): Change
address argument type from unsigned long to kernel_ureg_t.

7 years agodecode_netlink: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 23:16:25 +0000 (23:16 +0000)]
decode_netlink: change address argument type from unsigned long to kernel_ureg_t

* defs.h (decode_netlink) Change address argument type
from unsigned long to kernel_ureg_t.
* netlink.c (fetch_nlmsghdr, decode_nlmsghdr_with_payload,
decode_netlink): Likewise.

7 years agoprint_seccomp_*: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 22:54:53 +0000 (22:54 +0000)]
print_seccomp_*: change address argument type from unsigned long to kernel_ureg_t

* defs.h (print_seccomp_filter, print_seccomp_fprog): Change
address argument type from unsigned long to kernel_ureg_t.
* seccomp.c (print_seccomp_filter, print_seccomp_fprog,
decode_seccomp_set_mode_strict): Likewise.

7 years agotprint_iov*: change address argument type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 22:47:02 +0000 (22:47 +0000)]
tprint_iov*: change address argument type from unsigned long to kernel_ureg_t

* defs.h (tprint_iov, tprint_iov_upto): Change address argument type
from unsigned long to kernel_ureg_t.
* io.c (tprint_iov, tprint_iov_upto): Likewise.

7 years agoprint_array: change tracee address type from unsigned long to kernel_ureg_t
Dmitry V. Levin [Tue, 20 Dec 2016 21:46:10 +0000 (21:46 +0000)]
print_array: change tracee address type from unsigned long to kernel_ureg_t

* defs.h (print_array): Change start_addr type from unsigned long
to kernel_ureg_t.
* util.c (print_array): Likewise.  Change the type of all tracee
address variables from unsigned long to kernel_ureg_t.

7 years agoRename LONG_LONG to ULONG_LONG and change it to return unsigned long long
Dmitry V. Levin [Fri, 23 Dec 2016 19:12:38 +0000 (19:12 +0000)]
Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long

In all places where LONG_LONG is used the destination already has type
unsigned long long, so it is quite natural to change LONG_LONG as well.

* defs.h (LONG_LONG): Rename to ULONG_LONG, change return type
from long long to unsigned long long.  All callers updated.

7 years agomem: remove redundant casts
Dmitry V. Levin [Fri, 23 Dec 2016 11:16:11 +0000 (11:16 +0000)]
mem: remove redundant casts

* mem.c (SYS_FUNC(old_mmap)): Remove redundant cast
from kernel_ureg_t to unsigned long.
[S390] (SYS_FUNC(old_mmap_pgoff)): Remove redundant cast
from unsigned int to unsigned long.

7 years agodesc: remove redundant casts
Dmitry V. Levin [Thu, 22 Dec 2016 23:36:32 +0000 (23:36 +0000)]
desc: remove redundant casts

* desc.c (umove_kulong_array_or_printaddr): Remove redundant cast
from uint32_t to kernel_ulong_t.
(SYS_FUNC(pselect6)): Remove redundant casts from kernel_ulong_t
to unsigned long.

7 years agoprint_sigevent: remove redundant cast
Dmitry V. Levin [Thu, 22 Dec 2016 17:07:24 +0000 (17:07 +0000)]
print_sigevent: remove redundant cast

* print_sigevent.c (print_sigevent): Remove redundant cast from
struct_sigevent.sigev_value.sival_ptr to unsigned long as the former
is not a pointer but an unsigned integer.

7 years agotests: fix xattr.test for the case when listxattr returns a long list
Dmitry V. Levin [Thu, 22 Dec 2016 22:34:23 +0000 (22:34 +0000)]
tests: fix xattr.test for the case when listxattr returns a long list

* tests/xattr.c (DEFAULT_STRLEN): New macro.
(main): Use it to limit the length passed to print_quoted_memory.
Print ellipsis when the list returned by listxattr is too long.

7 years agotests: test for correct ellipsis with -s in xattr
Gabriel Laskar [Thu, 22 Dec 2016 15:10:52 +0000 (16:10 +0100)]
tests: test for correct ellipsis with -s in xattr

* tests/xattr-strings.c: New file.
* tests/xattr-strings.test: New test.
* tests/.gitignore: Add xattr-string.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add xattr-string.test.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
7 years agoxattr: use printstr_ex instead of print_quoted_string
Gabriel Laskar [Thu, 22 Dec 2016 15:10:51 +0000 (16:10 +0100)]
xattr: use printstr_ex instead of print_quoted_string

This fixes the display when using `-s` to limit the string size
of the values displayed by {get,set}xattr.

* xattr.c (print_xattr_val): Remove static buffer.  Use printstr_ex
instead of print_quoted_string.

Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
7 years agotests: use scno.h in finit_module, kcmp, renameat2 tests
Eugene Syromyatnikov [Tue, 20 Dec 2016 23:49:04 +0000 (02:49 +0300)]
tests: use scno.h in finit_module, kcmp, renameat2 tests

* tests/finit_module.c: Include "scno.h".
* tests/kcmp.c: Likewise.
* tests/renameat2.c: Likewise.

7 years agosock: cast pointers to kernel_ureg_t instead of unsigned long
Dmitry V. Levin [Wed, 21 Dec 2016 14:12:17 +0000 (14:12 +0000)]
sock: cast pointers to kernel_ureg_t instead of unsigned long

* sock.c (decode_ifconf): Cast ifconf.ifc_buf pointer to kernel_ureg_t
instead of unsigned long.