IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
IOV_MAX appears to be more portable than UIO_MAXIOV.
* msghdr.c: Include <limits.h>. Remove fallback defintion of UIO_MAXIOV.
(get_optmem_max): Replace UIO_MAXIOV with IOV_MAX.
* tests/msg_control.c: Likewise.
As we've got a proper mechanism that parsers can use for storing private
data between entering and exiting stages, all cases of struct tcb.auxstr
abuse should go.
* btrfs.c (btrfs_ioctl): Use set_tcb_priv_ulong and get_tcb_priv_ulong
instead of abusing tcp->auxstr.
* file_handle.c (SYS_FUNC(name_to_handle_at)): Likewise.
* msghdr.c (SYS_FUNC(recvmsg)): Likewise.
* net.c (decode_sockname, SYS_FUNC(recvfrom)): Likewise.
* v4l2.c (print_v4l2_queryctrl): Likewise.
As the msghdr.msg_namelen argument of recvmsg syscall has the same
read-write semantics as the address length argument of recvfrom syscall,
parser of recvmsg syscall needs a similar fix.
* defs.h (fetch_msghdr_namelen): New prototype.
(decode_msghdr): Add "int *" argument.
* msghdr.c (print_msghdr): Likewise. Treat it as a pointer to struct
msghdr.msg_namelen passed to the kernel. Pass to decode_sockaddr
the size of socket address actually returned by the kernel.
Print both user and kernel address lengths when the value changes.
(decode_msghdr, decode_mmsghdr): Add "int *" argument,
forward it to print_msghdr.
(decode_mmsgvec): Update decode_mmsghdr invocation.
(fetch_msghdr_namelen): New function.
* net.c (SYS_FUNC(sendmsg)): Update decode_msghdr invocation.
(SYS_FUNC(recvmsg)): Use fetch_msghdr_namelen on entering to save
struct msghdr.msg_namelen. On exiting, pass the saved value
to decode_msghdr.
Introduce a general socket netlink parser which prints the header and
a string for the remaining part of the buffer. It doesn't handle all
the netlink flags and types yet because the parser needs more
information, this will be implemented later.
* net.c (decode_sockbuf): New function.
(SYS_FUNC(send), SYS_FUNC(sendto), SYS_FUNC(recv), SYS_FUNC(recvfrom)):
Use it instead of printstr.
* msghdr.c (print_msghdr): Pass IOV_DECODE_NETLINK to tprint_iov_upto()
for netlink sockets.
* netlink.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (decode_netlink, getfdproto): New prototypes.
(iov_decode): Add IOV_DECODER_NETLINK.
* io.c (print_iovec): Use decode_netlink().
* util.c (getfdproto): Remove static keyword.
* xlat/netlink_flags.in: New file.
* xlat/netlink_types.in: New file.
Limit output of struct msghdr.msg_control when
struct msghdr.msg_controllen is greater than the maximum ancillary
buffer size specified in /proc/sys/net/core/optmem_max file.
* configure.ac (AC_CHECK_FUNCS): Add open64.
* defs.h (read_int_from_file): New prototype.
* util.c (read_int_from_file): New function.
* msghdr.c (get_optmem_max): New function based on read_int_from_file.
(decode_msg_control): Use it to check control_len argument.
* tests/msg_control.c (test_big_len): New function.
(main): Use it to test printing of excessively large messages.
* msghdr.c (print_cmsg_ip_opts): Do not print more than max_strlen
bytes of ip options in abbrev mode.
* tests/msg_control.c (print_ip_opts): Use DEFAULT_STRLEN.
(test_sol_ip): Test IP_RETOPTS output in abbrev mode.
* msghdr.c (print_scm_rights): Do not print more than max_strlen
descriptors in abbrev mode.
* tests/msg_control.c (DEFAULT_STRLEN): New macro.
(print_fds): Use it.
(test_scm_rights3): New function.
(main): Use it to test SCM_RIGHTS output in abbrev mode.
* tests/msg_control-v.c: New file.
* tests/msg_control-v.test: New test.
* tests/.gitignore: Add msg_control-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add msg_control-v.test.
* msghdr.c (print_cmsg_ip_ttl): Rename to print_cmsg_uint.
(print_cmsg_ip_checksum): Remove.
(print_cmsg_type_data): Replace print_cmsg_ip_ttl
and print_cmsg_ip_checksum with print_cmsg_uint.
* defs.h (msg_flags, socketlayers, decode_msghdr, decode_mmsg):
New prototypes.
* msghdr.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* net.c: Move all msghdr and mmsghdr parsers to msghdr.c.