Dmitry V. Levin [Fri, 30 Dec 2016 09:43:12 +0000 (09:43 +0000)]
tests: do not use defs.h and syscall.h
* tests/generate_scno.c: Include "tests.h", "sysent.h", <stdio.h>,
<string.h>, and <asm/unistd.h> instead of "defs.h" and "syscall.h".
* tests/ksysent.c: Likewise.
* tests/nsyscalls.c: Include "tests.h", "sysent.h", <errno.h>,
<stdio.h>, and <unistd.h> instead of "defs.h" and "syscall.h".
loop: add fallback definitions for LOOP_* ioctl command constants
Since these are architecture-independent and have been added over the
kernel's lifetime, it makes sense to have these definitions in strace
itself.
* xlat/loop_cmds.in: New file.
* loop.c: Include "xlat/loop_cmds.h".
(loop_ioctl): Eliminate conditional compilation based on availability
of LOOP_* constant definitions.
Dmitry V. Levin [Thu, 29 Dec 2016 00:30:26 +0000 (00:30 +0000)]
xlat: extend syntax
* xlat/gen.sh: Implement #stop directive that stops preprocessor
at the line it has been encountered during the first pass. This could
be used, for example, to provide fallback definitions for constants
without defining xlat tables.
loop: mpersify struct loop_info and loop_ioctl function
struct loop_info contains fields of type long, so it definitely should
have been mpersified.
* defs.h (loop_ioctl): Remove prototype.
* loop.c (struct_loop_info): New typedef.
Include DEF_MPERS_TYPE(struct_loop_info) and MPERS_DEFS.
(decode_loop_info): Replace struct loop_info with struct_loop_info.
Cast lo_inode, lo_init[0], and lo_init[1] to kernel_ulong_t and print
them using appropriate format specifiers.
(loop_ioctl): Wrap into MPERS_PRINTER_DECL.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Move device number printing code into a separate routine
* print_dev_t.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (print_dev_t): New prototype.
* dm.c: Do not include <sys/sysmacros.h>.
(dm_decode_device, dm_print_dev, dm_decode_dm_name_list): Use
print_dev_t function for printing device numbers.
* mknod.c: Do not include <sys/sysmacros.h>.
(decode_mknod): Use print_dev_t function for printing device number.
* print_struct_stat.c: Do not include <sys/sysmacros.h>.
(print_struct_stat): Use print_dev_t function for printing device
numbers.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Wed, 28 Dec 2016 22:33:38 +0000 (22:33 +0000)]
tests: enhance invalid address decoding check in seccomp-strict.test
* tests/seccomp-strict.c (main): Change the type of addr variable
containg the invalid address from unsigned long to kernel_ulong_t,
print it using %#llx format.
This extends the fault injection capability with :signal=SIG option
which injects a signal on entering each syscall from the specified set.
:signal and :error options are complementary, if they are both specified
the syscall will be fault injected as usual and the specified signal
will be delivered to the tracee.
* defs.h (struct fault_opts): Change the type of err field to int16_t,
add signo field.
(trace_syscall): Add a pointer argument.
* qualify.c: Include "nsig.h".
(parse_fault_token): Handle signal= option.
(qualify_fault): Update default fault_opts.
* strace.c (trace): Forward signal number from trace_syscall
to ptrace_restart(PTRACE_SYSCALL).
* syscall.c (inject_syscall_fault_entering): Add pointer argument,
save there the signal number specified by fault options. Do not inject
a syscall fault unless instructed by fault options.
(update_syscall_fault_exiting): Update the error code injection check.
(trace_syscall_entering): Add pointer argument, forward it to
inject_syscall_fault_entering.
(trace_syscall): Add pointer argument, forward it to
trace_syscall_entering.
Signed-off-by: Seraphime Kirkovski <kirkseraph@gmail.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Mon, 26 Dec 2016 17:47:55 +0000 (17:47 +0000)]
Replace widen_to_ulong with truncate_kulong_to_current_wordsize
* defs.h (widen_to_ulong): Remove.
(truncate_kulong_to_current_wordsize): New static inline function.
* io.c (do_preadv, do_pwritev): Use it instead of widen_to_ulong.
Dmitry V. Levin [Mon, 26 Dec 2016 17:06:12 +0000 (17:06 +0000)]
Simplify print_lld_from_low_high_val ifdefery
The demise of HAVE_STRUCT_TCB_EXT_ARG opens the way for a simpler
implementation.
* io.c (print_lld_from_low_high_val): Merge [SIZEOF_LONG > 4
&& SIZEOF_LONG == SIZEOF_LONG_LONG]
and [SIZEOF_KERNEL_LONG_T > SIZEOF_LONG] cases
into a single [SIZEOF_KERNEL_LONG_T > 4] case.
[SIZEOF_KERNEL_LONG_T == 4]: Use direct casts to long long
instead of zero_extend_signed_to_ull.
prctl: print pointer returned by PR_GET_TID_ADDRESS as kernel long
Since there is no compat handler for x32/n32, kernel returns kernel's
long as a result of the call.
Interesting, does any callee out there actually care to have enough room
allocated for kernel long?
* prctl.c (SYS_FUNC(prctl)): Use printnum_kptr instead of printnum_ptr
to print the value stored at address pointed by addr2 argument
of PR_GET_TID_ADDRESS operation.
Add functions for printing pointers of kernel_ulong_t size
In cases where no compat for x32/n32 is implemented, pointer is of
kernel's long size, so it should be printed appropriately.
* defs.h [!current_klongsize] (printnum_addr_klong_int): New prototype.
(printnum_kptr): New macro.
* util.c [!current_klongsize] (printnum_addr_klong_int): New function.
Originally, printnum_long_int was used, but it prints NULL incorrectly.
* defs.h (DECL_PRINTNUM_ADDR): New macro.
(DECL_PRINTNUM_ADDR(int), DECL_PRINTNUM_ADDR(int64)): New prototypes.
[!current_wordsize] (printnum_addr_long_int): New prototype.
[!current_wordsize] (printnum_ptr): Use it.
[current_wordsize > 4] (printnum_ptr): Use printnum_addr_int64.
[current_wordsize == 4] (printnum_ptr) Use printnum_addr_int.
* util.c (DEF_PRINTNUM_ADDR): New macro.
(DEF_PRINTNUM_ADDR(int, unsigned int),
DEF_PRINTNUM_ADDR(int64, uint64_t)): New macro instantiations that
provide printnum_addr_int and printnum_addr_int64, accordingly.
[!current_wordsize] (printnum_addr_long_int): New function.
* xet_robust_list.c (sprintaddr): New function.
(main): Use it, update expected output.
* tests/ipc_sem.c (main): Update expected output.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Dmitry V. Levin [Mon, 26 Dec 2016 13:18:00 +0000 (13:18 +0000)]
umoven: detect invalid addresses
Do not silently truncate tracee addresses to current_wordsize.
After transition from long to kernel_ulong_t there should be no sign
extension issues with tracee addresses, and invalid addresses should
be printed properly.
* util.c (umoven): Check [SIZEOF_KERNEL_LONG_T > 4] instead
of [SIZEOF_LONG > 4], reject addresses that do not fit into
current_wordsize.
* tests/umoven-illptr.c: New file.
* tests/umoven-illptr.test: New test.
* tests/.gitignore: Add umoven-illptr.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add umoven-illptr.test.
Dmitry V. Levin [Mon, 26 Dec 2016 12:16:38 +0000 (12:16 +0000)]
umovestr: detect invalid addresses
Do not silently truncate tracee addresses to current_wordsize.
After transition from long to kernel_ulong_t there should be no sign
extension issues with tracee addresses, and invalid addresses should
be printed properly.
* util.c (umovestr): Check [SIZEOF_KERNEL_LONG_T > 4] instead
of [SIZEOF_LONG > 4], reject addresses that do not fit into
current_wordsize.
* tests/umovestr-illptr.c: New file.
* tests/umovestr-illptr.test: New test.
* tests/.gitignore: Add umovestr-illptr.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add umovestr-illptr.test.
Dmitry V. Levin [Mon, 26 Dec 2016 10:26:03 +0000 (10:26 +0000)]
Automatically replace kernel_(scno|ureg)_t with kernel_ulong_t
Remove temporary types created for transition from long
to kernel_ulong_t.
Automatically replace kernel_scno_t and kernel_ureg_t with
kernel_ulong_t using
$ git grep -El 'kernel_(scno|ureg)_t' |
xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g'
* kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove.
All users updated.
Dmitry V. Levin [Mon, 26 Dec 2016 00:55:54 +0000 (00:55 +0000)]
Redirect kernel_ureg_t and kernel_scno_t from unsigned long to kernel_ulong_t
* defs.h (struct tcb): Change u_rval type from long to kernel_long_t.
(PRI_krd, PRI_kru, PRI_krx): Redirect to PRI_kld, PRI_klu, and PRI_klx.
* kernel_types.h (kernel_scno_t, kernel_ureg_t): Redirect
to kernel_ulong_t.
Dmitry V. Levin [Mon, 26 Dec 2016 01:21:04 +0000 (01:21 +0000)]
vm_read_mem: detect address truncation
When sizeof(kernel_ureg_t) > sizeof(long), the tracee address passed
to vm_read_mem could be silently truncated. Detect this situation
and return EIO when the tracee address does not fit into unsigned long.
* util.c (vm_read_mem): Save raddr argument into a temporary variable
truncated_raddr of type unsigned long. Set errno to EIO and return -1
when truncated_raddr does not equal to raddr.
Dmitry V. Levin [Sun, 25 Dec 2016 23:24:08 +0000 (23:24 +0000)]
signal: cleanup decoding of sa_handler and sa_restorer
Change type of sa_handler and sa_restorer fields from function pointers
to unsigned long. This saves the code from a lot of casts between
pointers and integers.
Rename __sa_handler to sa_handler__ as names starting with underscore
symbol are reserved and should not be used.
* signal.c (old_sigaction): Rename __sa_handler to sa_handler__,
all users updated. Change the type of sa_handler__ and sa_restorer
from pointer to unsigned long.
(old_sigaction32): Rename __sa_handler to sa_handler__, all users
updated.
(decode_old_sigaction): Remove now redundant casts from
old_sigaction32.sa_handler__ to old_sigaction.sa_handler__,
from old_sigaction32.sa_restorer to old_sigaction.sa_restorer,
and from old_sigaction.sa_handler__ to unsigned long. Print
old_sigaction.sa_restorer using printaddr.
* signal.c (new_sigaction): Rename __sa_handler to sa_handler__,
all users updated. Change the type of sa_handler__ and sa_restorer
from pointer to unsigned long.
(new_sigaction32): Rename __sa_handler to sa_handler__, all users
updated.
(decode_new_sigaction): Remove now redundant casts from
new_sigaction32.sa_handler__ to new_sigaction.sa_handler__,
from new_sigaction32.sa_restorer to new_sigaction.sa_restorer,
and from new_sigaction.sa_handler__ to unsigned long. Print
new_sigaction.sa_restorer using printaddr.
Dmitry V. Levin [Sun, 25 Dec 2016 21:59:59 +0000 (21:59 +0000)]
Use printxval64 instead of printxval_long
After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
to stop using printxval_long proxy and pass syscall arguments directly
to printxval64.
Dmitry V. Levin [Sun, 25 Dec 2016 21:55:01 +0000 (21:55 +0000)]
Use printflags64 instead of printflags_long
After the change of tcb.u_arg type from long to kernel_ureg_t it is safe
to stop using printflags_long proxy and pass syscall arguments directly
to printflags64.
Dmitry V. Levin [Sun, 25 Dec 2016 12:53:14 +0000 (12:53 +0000)]
upeek, upoke: change argument types from long to unsigned long
* defs.h (upeek, upoke): Change offset argument type from long
to unsigned long. Change res argument type from long to kernel_ureg_t.
* upeek.c (upeek): Likewise.
* upoke.c (upoke.c): Likewise.
* syscall.c (print_pc) [ARCH_PC_PEEK_ADDR]: Change pc type from long
to kernel_ureg_t.
* linux/aarch64/arch_regs.c (arm_sp_ptr): Remove redundant cast.
* linux/metag/get_syscall_args.c (get_syscall_args): Likewise.
* linux/sh/get_syscall_result.c (get_syscall_result_regs): Likewise.
* linux/sh64/get_syscall_result.c (get_syscall_result_regs): Likewise.
* linux/powerpc/getregs_old.c (getregs_old): Remove redundant casts.
* linux/alpha/arch_getrval2.c (getrval2): Change r20 type from long
to unsigned long.
* linux/alpha/arch_regs.c (alpha_r0, alpha_a3): Change type from long
to unsigned long.
* linux/bfin/arch_regs.c (bfin_r0): Likewise.
* linux/crisv10/arch_regs.c (cris_r10): Likewise.
* linux/hppa/arch_regs.c (hppa_r28): Likewise.
* linux/ia64/arch_regs.c (IA64_PSR_IS): Likewise.
* linux/microblaze/arch_regs.c (microblaze_r3): Likewise.
* linux/sh/arch_regs.c (sh_r0): Likewise.
* linux/sh64/arch_regs.c (sh64_r9): Likewise.
* linux/xtensa/arch_regs.c (xtensa_a2): Likewise.
* linux/alpha/arch_sigreturn.c (arch_sigreturn): Change addr type
from long to unsigned long.
* linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/alpha/get_scno.c (arch_get_scno): Update for the change
of signedness.
* linux/arc/get_syscall_args.c (get_syscall_args): Change arc_args type
from pointer to long to pointer to unsigned long.
* linux/arm/arch_regs.c (arm_sp_ptr): Change type from pointer to long
to pointer to unsigned long.
* linux/arm/arch_regs.h (arm_sp_ptr): Likewise.
* linux/i386/arch_regs.c (i386_esp_ptr): Likewise.
* linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
* linux/m68k/arch_regs.c (m68k_usp_ptr): Likewise.
* linux/m68k/arch_regs.h (m68k_usp_ptr): Likewise.
* linux/ia64/get_syscall_args.c (get_syscall_args): Use umove
instead of umoven.
* linux/sh/arch_getrval2.c (getrval2): Change val type from long
to unsigned long.
Dmitry V. Levin [Sun, 25 Dec 2016 09:47:03 +0000 (09:47 +0000)]
arch_sigreturn: change tracee address type from long to unsigned long
* linux/arm/arch_sigreturn.c (arch_sigreturn): Change addr variable
type from long to unsigned long.
* linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/m68k/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/powerpc/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/s390/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/sparc/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise.
* linux/crisv10/arch_sigreturn.c (arch_sigreturn): Change the type
of addr and regs variables from long to unsigned long.
* linux/mips/arch_sigreturn.c (arch_sigreturn): Change addr variable
type from long to kernel_ureg_t.
* linux/x86_64/arch_sigreturn.c (arch_sigreturn): Change the type
of offset and addr variables from long to kernel_ureg_t.
Dmitry V. Levin [Sun, 25 Dec 2016 03:03:34 +0000 (03:03 +0000)]
kexec: change flags type from unsigned long to kernel_ureg_t
* kexec.c (SYS_FUNC(kexec_load)): Change n variable type
from unsigned long to kernel_ureg_t. Use printxval64 instead
of printxval_long. Use printflags64 instead of printflags_long.
Dmitry V. Levin [Sun, 25 Dec 2016 02:58:00 +0000 (02:58 +0000)]
kexec: change types of pointers and sizes to kernel_ureg_t
* kexec.c (print_seg): Change the type of *seg and seg_buf variables
from unsigned long to kernel_ureg_t.
(print_kexec_segments): Change len argument type from unsigned long
to kernel_ureg_t. Change seg variable type from unsigned long
to kernel_ureg_t.
Dmitry V. Levin [Sun, 25 Dec 2016 01:31:49 +0000 (01:31 +0000)]
netlink: change size types from unsigned long to kernel_ureg_t
* defs.h (decode_netlink): Change len argument type from unsigned long
to kernel_ureg_t.
* netlink.c (fetch_nlmsghdr): Likewise.
(decode_nlmsghdr_with_payload): Likewise. Change nlmsg_len variable
type from unsigned long to unsigned int.
(decode_netlink): Change the type of len argument and next_len variable
from unsigned long to kernel_ureg_t. Change nlmsg_len variable type
from unsigned long to unsigned int.
Dmitry V. Levin [Sun, 25 Dec 2016 01:11:24 +0000 (01:11 +0000)]
ipc_msg: change size types from unsigned long to kernel_ureg_t
* ipc_msg.c (tprint_msgsnd): Change count argument type
from unsigned long to kernel_ureg_t. Change flags argument type
from unsigned long to unsigned int.
(tprint_msgrcv): Change the type of count and msgtyp arguments
from unsigned long to kernel_ureg_t.
(fetch_msgrcv_args): Change *pair type from unsigned long
to kernel_ureg_t.
(SYS_FUNC(msgrcv)): Change pair type from unsigned long
to kernel_ureg_t.
* print_msgbuf.c (tprint_msgbuf): Change count argument type
from unsigned long to kernel_ureg_t.
Dmitry V. Levin [Sun, 25 Dec 2016 00:53:52 +0000 (00:53 +0000)]
dumpiov_upto: change size types from unsigned long to kernel_ureg_t
* defs.h (dumpiov_upto): Change data_size argument type
from unsigned long to kernel_ureg_t.
* util.c (dumpiov_upto): Change the type of data_size argument
and iov_len variable from unsigned long to kernel_ureg_t.
Dmitry V. Levin [Sun, 25 Dec 2016 00:30:28 +0000 (00:30 +0000)]
msghdr: change cmsghdr size types from size_t to unsigned int
As the kernel does not accept control messages longer than the value
of int sysctl_optmem_max kernel variable exported as
/proc/sys/net/core/optmem_max, we do not print them either.
Since unsigned int has enough room to contain any valid control message
size, change all internal cmsghdr size types from size_t
to unsigned int.
* msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
print_cmsg_ip_pktinfo, print_cmsg_uint, print_cmsg_uint8_t,
print_cmsg_ip_opts, print_cmsg_ip_recverr, print_cmsg_ip_origdstaddr,
cmsg_printer, print_cmsg_type_data): Change data_len argument type
from size_t to unsigned int.
(cmsg_socket_printers): Change min_len type from size_t to unsigned int.
(decode_msg_control): Change the type of in_control_len argument,
cmsg_len, and len variables from size_t to kernel_ureg_t.
Change the type of cmsg_size, control_len, and buf_len variables
from size_t to unsigned int.
Dmitry V. Levin [Sun, 25 Dec 2016 00:20:30 +0000 (00:20 +0000)]
msghdr: change register based size types from unsigned long to kernel_ureg_t
* defs.h (dumpiov_in_msghdr): Change data_size argument type
from unsigned long to kernel_ureg_t.
* msghdr.h (print_struct_msghdr): Likewise.
* msghdr.c (print_struct_msghdr): Likewise. Cast msghdr.msg_iovlen
and msghdr.msg_controllen to kernel_ureg_t instead of unsigned long.
(decode_msghdr, dumpiov_in_msghdr): Change data_size argument type
from unsigned long to kernel_ureg_t.
(SYS_FUNC(sendmsg)): Pass -1 instead of -1UL as data_size argument
to decode_msghdr.
* mmsghdr.c (print_struct_mmsghdr): Pass (kernel_ureg_t) -1 instead
of -1UL as data_size argument to print_struct_msghdr.
(dumpiov_in_mmsghdr): Cast msghdr.msg_iovlen to kernel_ureg_t instead
of unsigned long.
* syscall.c (dumpio): Pass -1 instead of -1UL as data_size argument
to dumpiov_in_msghdr
Dmitry V. Levin [Sat, 24 Dec 2016 23:09:16 +0000 (23:09 +0000)]
io: change size types from unsigned long to kernel_ureg_t
* defs.h (tprint_iov_upto): Change the type of len and data_size
arguments from unsigned long to kernel_ureg_t.
(tprint_iov): Change the type of len argument from unsigned long
to kernel_ureg_t.
* io.c (print_iovec_config): Change data_size type from unsigned long
to kernel_ureg_t.
(print_iovec): Change the type of *iov, iov_buf, and len variables
from unsigned long to kernel_ureg_t.
(tprint_iov_upto): Change the type of len and data_size arguments, and
the type of iov variable from unsigned long to kernel_ureg_t.
Dmitry V. Levin [Sat, 24 Dec 2016 22:39:06 +0000 (22:39 +0000)]
mem: change mmap arguments type from unsigned long to kernel_ureg_t
* mem.c (print_mmap): Change the type of len, prot, and flags
from unsigned long to kernel_ureg_t. Use printflags64 instead
of printflags_long. Use printxval64 instead of printxval_long.
(SYS_FUNC(old_mmap)): Check for current_klongsize instead
of [AARCH64 || X86_64] to take X32 into account.
(SYS_FUNC(mremap)): Use printflags64 instead of printflags_long.
(SYS_FUNC(remap_file_pages)): Change the type of size, prot, pgoff, and
flags from unsigned long to kernel_ureg_t. Use printflags64 instead
of printflags_long. Use printxval64 instead of printxval_long.
[POWERPC] (SYS_FUNC(subpage_prot)): Change the type of len and nmemb
from unsigned long to kernel_ureg_t.
Dmitry V. Levin [Sat, 24 Dec 2016 22:12:16 +0000 (22:12 +0000)]
numa: change size arguments type from unsigned long to kernel_ureg_t
* numa.c (print_node, print_addr): Add kernel_ureg_t support.
(print_nodemask): Change type of maxnodes argument from unsigned long
to kernel_ureg_t.
(SYS_FUNC(move_pages)): Change npages type from unsigned long
to kernel_ureg_t. Change buf type from long to kernel_ureg_t.
Dmitry V. Levin [Sat, 24 Dec 2016 21:50:37 +0000 (21:50 +0000)]
print_sigset_addr_len: change len argument type from long to kernel_ureg_t
* defs.h (print_sigset_addr_len): Change len argument type from long
to kernel_ureg_t.
* signal.c (print_sigset_addr_len_limit, print_sigset_addr_len): Likewise.
Dmitry V. Levin [Sat, 24 Dec 2016 21:31:20 +0000 (21:31 +0000)]
process_vm: change size arguments type from unsigned long to kernel_ureg_t
* process_vm.c (SYS_FUNC(process_vm_readv),
SYS_FUNC(process_vm_writev)): Change the type of local_iovcnt,
remote_iovcnt, and flags from unsigned long to kernel_ureg_t.
Dmitry V. Levin [Sat, 24 Dec 2016 19:20:25 +0000 (19:20 +0000)]
xattr: change size arguments type from unsigned long to kernel_ureg_t
* xattr.c (print_xattr_val): Change type of insize and size arguments
from unsigned long to kernel_ureg_t.
(print_xattr_list): Change type of size argument from unsigned long
to kernel_ureg_t.
Dmitry V. Levin [Sat, 24 Dec 2016 17:35:40 +0000 (17:35 +0000)]
printstr_ex: fix decoding of non-NUL-terminated strings when len == -1
Do not treat len == -1 in any special way. All users who need the
string to be handled as a NUL-terminated string set QUOTE_0_TERMINATED
bit in user_style flags already.
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.
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.