* syslog.c (SYS_FUNC(syslog)): Store conversion to int of tcp->u_arg[2]
in len; print address using printaddr64 (as syslog doesn't use compat
for x32), and third argument as int (as it has this type in the syscall
handler).
* tests/syslog.c: Add checks.
syslog: do not print bufp and len for commands that ignore them
* syslog.c (SYS_FUNC(syslog)): Defer printing of comma after the first
argument to the specific command handlers, return RVAL_DECODED without
additional printing for SYSLOG_ACTION_CLOSE, SYSLOG_ACTION_OPEN,
SYSLOG_ACTION_CLEAR, SYSLOG_ACTION_CONSOLE_OFF,
SYSLOG_ACTION_CONSOLE_ON, SYSLOG_ACTION_SIZE_UNREAD,
SYSLOG_ACTION_SIZE_BUFFER.
* tests/syslog.c: Add checks.
* strace.1.in (.SH SYNOPSIS): add second "-q", "-w", second "-y", "-z",
and "-Z" to normal call variant; add "-w", "-z" and "-Z" to syscall
statistics call variant.
The current implementation doesn't work as intended since in case the
condition is false, .ig has no effect and it results in "warning: macro
'end_unwind_opt' not defined". Rewrite it into something more dumb and
verbose, but hopefully correct.
* strace.1.in (.SH SYNOPSYS, .SS Output format): Prepend each
conditional line with respective ".if" instead of trying to wrap
it in ".ig".
* strace.1.in (.SH OPTIONS): Insert ".SS General" at the beginning of
the section; move ".SS Startup" after ".SS General"; move ".SS Tracing"
after ".SS Startup"; move ".SS Filtering" after ".SS Startup"; insert
".SS Tampering" after ".SS Statistics"; move "-e expr" from ".SS
Filtering" to ".SS General"; move "-e abbrev", "-e verbose", "-e raw",
"-e read", "-e write", "-e kvm=vcpu" and "-v" from ".SS Filtering"
to ".SS Output format"; move "-e inject" and "-e fault" from
".SS Filtering" to ".SS Tampering".
Pierre Marsais [Sun, 4 Aug 2019 15:39:29 +0000 (16:39 +0100)]
Fix invalid free in trace_close_memstream
In maybe_switch_tcbs we exchange the pointers to the memstream's buffers
between 2 tcb, however the libc doesn't know and keeps updating the
tcb->memfptr as if the exchange didn't happen. This leads to
unsynchronized tcb->memfptr and tcb->outf and invalid frees.
Adding a new indirection fixes the problem.
* stage_output.c (struct staged_output_data): New struct.
(strace_open_memstream, strace_close_memstream): Use it.
* defs.h (struct tcb): Replace real_outf, memfptr, and memfloc
with a pointer to struct staged_output_data.
* strace.c (maybe_switch_tcbs): Use it.
* syscall.c (print_syscall_resume): Ditto.
Signed-off-by: Pierre Marsais <pierre.marsais@lse.epita.fr>
Jeremy Kerr [Fri, 2 Aug 2019 03:01:29 +0000 (11:01 +0800)]
net: Fix access beyond tracee buffer for MSG_TRUNC receives
The recv(), recvfrom() and recvmsg() calls allow a MSG_TRUNC flag, which
indicates that the kernel should return the available size of an
incoming message, rather than the received size.
When strace-ing a truncated recv(), strace will try to access a
return-value size area of the tracee's buffer, which may be larger than
the actual buffer:
Rename struct xlat to struct xlat_data and make struct xlat an xlat
descriptor that contains various information about xlat.
So far it's the type and the number of items.
As a result, xlookup/printxval now have enough information for handling
xlat depending on its type, so *index/*_search API is not needed any
longer.
* xlat.h (struct xlat_data): Rename from struct xlat.
(struct xlat): New type definition.
* xlat.c (xlat_search, printxval_sized, printxval_searchn_ex, xlat_idx,
printxval_indexn_ex, printxval_dispatch_ex): Remove.
(xlookup): Handle xlat_data based on xlat type.
(xlat_search_eq_or_less, xlookup_le): New functions.
(sprintflags_ex, printflags_ex): Update.
* xlat/gen.sh (gen_header): Add handling for #sorted, generate new
struct xlat descriptor.
* defs.h (arp_hardware_types_size, ethernet_protocols_size,
inet_protocols_size, evdev_abs_size, xlat_search, xlat_idx,
printxval_searchn_ex, printxval_searchn, printxval_search,
printxval_search_ex, printxval_indexn_ex, printxval_indexn,
printxval_index, printxval_index_ex, printxval_dispatch_ex,
printxval_dispatch): Remove.
(enum xlat_style_private_flag_bits): Remove PAF_INDEX_XLAT_SORTED_BIT
and PAF_INDEX_XLAT_VALUE_INDEXED_BIT.
(enum xlat_style_private_flag): Remove PAF_INDEX_XLAT_SORTED and
PAF_INDEX_XLAT_VALUE_INDEXED.
(print_array_ex): Remove index_xlat_size argument.
(xlookup_le): New declaration.
(printxval_ex): New macro.
* dyxlat.c (struct dyxlat): Remove used field (use xlat.size instead),
embed struct xlat, add pointer to struct xlat_data.
(MARK_END): Remove.
(dyxlat_alloc, dyxlat_free, dyxlat_get, dyxlat_add_pair): Update in
accordance with the structure changes.
* evdev.c (evdev_abs_size): Remove.
(keycode_ioctl): Use printxval instead of printxval_index.
(decode_bitset): Remove.
(decode_bitset_): Rename to decode_bitset, remove decode_nr_size and xt
arguments, call printxval instead of printxval_dispatch.
(bit_ioctl, evdev_read_ioctl): Do not pass xlat type to decode_bitset.
* fsconfig.c (SYS_FUNC(fsconfig)): Use printxval instead of
printxval_index.
* print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED,
PRINT_FIELD_XVAL_INDEX): Remove.
* nlattr.h (struct decode_nla_xlat_opts): Remove xlat_size and xt
fields.
* nlattr.c (decode_nla_meminfo): Do not pass
PAF_INDEX_XLAT_VALUE_INDEXED flag and netlink_sk_meminfo_indices size
in a print_array_ex call.
(decode_nla_xval): Call printxval_ex instead of printxval_dispatch_ex.
(decode_nla_ether_proto, decode_nla_ip_proto): Do not pass xlat_size and
xt fields in opts.
(decode_nla_flags): Remove XT_INDEXED unsupported warning.
* process.c (struct_user_offsets_data): Rename from struct_user_offsets,
change type to struct xlat_data[].
(struct_user_offsets): New xlat description.
(print_user_offset_addr): Rewrite using xlookup_le.
* util.c (print_array_ex): Remove index_xlat_size argument, simply call
printxval_ex for index printing.
* aio.c (tprint_lio_opcode): Use printxval_ex instead of
printxval_indexn_ex.
* bpf.c: Use printxval instead of printxval_index; use PRINT_FIELD_XVAL
instead of PRINT_FIELD_XVAL_INDEX.
* bpf_filter.c (print_bpf_filter_code): Use printxval instead of
printxval_index.
* ioctl.c (evdev_decode_number): Use printxval instead of
printxval_indexn.
* kvm.c (kvm_ioctl_decode_check_extension): Use printxval64 instead of
printxval_index.
(kvm_ioctl_run_attach_auxstr): Use xlookup instead of xlat_idx.
* net.c: Use printxval instead of printxval_search/printxval_index, use
printxval_ex instead of printxval_searchn_ex.
* netlink.c (get_fd_nl_family): Rewrite using xlat descriptor structure.
* netlink_packet_diag.c (decode_packet_diag_msg): Use PRINT_FIELD_XVAL
instead of PRINT_FIELD_XVAL_SORTED_SIZED.
* netlink_smc_diag.c (decode_smc_diag_shutdown): Remove ARRSZ_PAIR
wrapper.
(decode_smc_diag_fallback): Use printxval_ex instead of
printxval_search_ex.
(decode_smc_diag_msg): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_INDEX.
* print_statfs.c (print_statfs_type): Use printxval instead of
printxval_search.
* ptrace_syscall_info.c (print_ptrace_syscall_info): Use
PRINT_FIELD_XVAL instead of PRINT_FIELD_XVAL_INDEX.
* rtnl_link.c (decode_ifla_inet6_flags, decode_ifla_inet6_agm):
Likewise.
(decode_nla_tun_type, decode_ifla_xdp_attached): Remove xlat_size,
xt fields.
(decode_ifla_inet_conf, decode_ifla_inet6_conf, decode_ifla_inet6_stats,
decode_ifla_inet6_icmp6_stats): Remove PAF_INDEX_XLAT_VALUE_INDEXED flag
and ARRSZ_PAIR wrapper in print_array_ex calls.
(decode_ifinfomsg): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_SORTED_SIZED.
* rtnl_route.c (decode_nla_rt_proto): Use printxval instead of
printxval_search.
* sock.c (print_ifreq): Use PRINT_FIELD_XVAL instead of
PRINT_FIELD_XVAL_SORTED_SIZED.
* sockaddr.c (print_sockaddr_data_ll, print_sockaddr_data_bt,
print_sockaddr): Use printxval instead of printxval_search and
printxval_index.
* time.c (getitimer, osf_getitimer, setitimer, osf_setitimer,
printclockname): Use printxval instead of printxval_index.
(do_adjtimex): Use xlookup instead of xlat_idx.
* tests/btrfs.c: Update xlat handling, use struct xlat_data instead of
struct xlat for XLAT() arrays.
* tests/ioctl_block.c: Likewise.
* tests/ioctl_rtc.c: Likewise.
* tests/printflags.c: Likewise.
* tests/printxval.c: Likewise.
* tests/prlimit64.c: Likewise.
* tests/setrlimit.c: Likewise.
* tests/socketcall.c: Likewise.
* tests/xgetrlimit.c: Likewise.
* tests/xstatfsx.c: Likewise.
* xlat/af_packet_versions.in: Add #value_indexed.
* xlat/arp_hardware_types.in: Add #sorted.
* xlat/ax25_protocols.in: Likewise.
* xlat/bluetooth_l2_cid.in: Likewise.
* xlat/bluetooth_l2_psm.in: Likewise.
* xlat/ethernet_protocols.in: Likewise.
* xlat/evdev_ff_types.in: Likewise.
* xlat/fsmagic.in: Likewise.
* xlat/hw_breakpoint_type.in: Likewise.
* xlat/iffflags.in: Likewise.
* xlat/inet6_if_flags.in: Likewise.
* xlat/inet_protocols.in: Likewise.
* xlat/msgctl_flags.in: Likewise.
* xlat/perf_hw_cache_id.in: Likewise.
* xlat/perf_hw_cache_op_id.in: Likewise.
* xlat/perf_hw_cache_op_result_id.in: Likewise.
* xlat/perf_hw_id.in: Likewise.
* xlat/perf_sw_ids.in: Likewise.
* xlat/perf_type_id.in: Likewise.
* xlat/routing_protocols.in: Likewise.
* xlat/semctl_flags.in: Likewise.
* xlat/shmctl_flags.in: Likewise.
* xlat/smc_decl_codes.in: Likewise.
* xlat/sock_ax25_options.in: Likewise.
* xlat/sock_bluetooth_options.in: Likewise.
* xlat/sock_dccp_options.in: Likewise.
* xlat/sock_tipc_options.in: Likewise.
* xlat/socketlayers.in: Likewise.
* xlat/v4l2_control_classes.in: Likewise.
* xlat/v4l2_pix_fmts.in: Likewise.
* xlat/v4l2_sdr_fmts.in: Likewise.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* defs.h [!MAX_ADDR_LEN] (MAX_ADDR_LEN): New macro.
(sprint_hwaddr): New declaration.
(print_hwaddr): New inline function, a wrapper for sprint_hwaddr.
* print_fields.h (PRINT_FIELD_HWADDR_SZ): New macro.
* print_mac.c: Include "xlat/arp_hardware_types.h" under
XLAT_MACROS_ONLY.
[!MAX_ADDR_LEN] (MAX_ADDR_LEN): Remove.
(sprint_hwaddr): New function.
* sock.c (print_ifreq) <SIOCSIFHWADDR, SIOCGIFHWADDR>: Print hardware
address using PRINT_FIELD_HWADDR_SZ.
open: implement sprint_open_modes using sprintflags_ex
* defs.h (sprintflags_ex): Add "sep" argument.
(sprintflags): Pass '\0' in "sep" argument.
* open.c (sprint_open_modes): Use sprintflags_ex for printing
open_mode_flags.
* xlat.c (sprintflags_ex): Add "sep" argument, use it as initial
separator (if not nul).
The current syslog test covers only those cases where the type parameter
is one of SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL,
SYSLOG_ACTION_READ_CLEAR as per codecov.
Add test case to cover the default case.
* tests/syslog.c (SYSLOG_ACTION_SIZE_BUFFER): New macro.
(main): Check SYSLOG_ACTION_SIZE_BUFFER decoding.
* xlat/aio_iocb_flags.in: New file.
* defs.h (pollflags, rwf_flags): New declarations.
* configure.ac (AC_CHECK_MEMBERS): Check for aio_flags and aio_rw_flags
fields of struct iocb.
* aio.c [HAVE_STRUCT_IOCB_AIO_FLAGS]: Include "xlat/aio_iocb_flags.h".
(AIO_RW_FLAGS_FIELD): New macro definition, defined based on the
presence of HAVE_STRUCT_IOCB_AIO_RW_FLAGS macro.
(iocb_sub): Add SUB_POLL.
(tprint_lio_opcode): Change IOCB_CMD_POLL subtype to SUB_POLL.
(print_common_flags): Conditionalize on HAVE_STRUCT_IOCB_AIO_FLAGS
instead of IOCB_FLAG_RESFD. Print aio_flags using aio_iocb_flags xlat.
(print_iocb_header): Always print aio_data. Print aio_rw_flags if it
is non-zero. Print aio_reqprio based on the presence of
IOCB_FLAG_IOPRIO flag in aio_flags (use print_ioprio if it set and print
as a signed integer otherwise).
(print_iocb): Decode SUB_POLL subtype.
* tests/aio.c: Update expected output.
Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
tests: serialize bpf-obj_get_info_by_fd based executables
Concurrent execution of many bpf-obj_get_info_by_fd based tests may
lead to a temporary resource shortage that causes them to fail with
the following error diagnostics:
BPF_MAP_CREATE failed: Operation not permitted
Avoid this issue by serializing execution of all relevant tests.
* tests/lock_file.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add lock_file.c
* tests/tests.h (lock_file_by_dirname): New prototype.
* tests/bpf-obj_get_info_by_fd.c (main): Call lock_file_by_dirname
to obtain an exclusive lock on bpf-obj_get_info_by_fd executable.
* tests/ioctl_evdev-success-v.test: Inject various values.
* tests/ioctl_evdev-success.test: Likewise.
* tests/ioctl_evdev-success.c (NUM_WORDS): New macro.
(struct evdev_check): Constify arg_ptr and print_arg args.
(invoke_test_syscall, test_evdev, print_input_absinfo, print_input_id,
print_mtslots): Add const qualifiers.
(print_getbit): Add const qualifiers, rewrite to expect trailing NULL
in the string array instead of leading string count.
(main): Set size for ev_more, ev_less, ev_zero arrays; replace leading
count element in ev_more_str, ev_less_str, ev_zero_str with trailing
NULL; replace ev_more_str and ev_less_str with ev_more_str_2/ev_less_str_2
and ev_more_str_3/ev_less_str_3 that differ by presence of flags that reside
beyond first two bytes; add static and const qualifiers where possible;
add key/key_sts_8/key_str_16 values; update a to provide either ev_more_str_2
or ev_more_str_3 and either key_str_8 or key_str_16 depending on inject_retval
value.
Paul Chaignon [Mon, 1 Apr 2019 20:50:45 +0000 (22:50 +0200)]
tests: check status qualifier
This change adds 8 test cases for -e status with unfinished, failed,
none, successful, detached, and the whole set. The test cases for
failed, successful, and the whole set use chdir(2). Threaded test cases
for unfinished and none rely on a child thread execve'ing the lead
thread. There are additional single-threaded tests for status=none and
status=unfinished. The test case for detached interrupts strace while
attached to a sleeping process.
Paul Chaignon [Sat, 15 Jun 2019 05:32:03 +0000 (07:32 +0200)]
Implement -e status=set option
The status qualifier enables filtering based on the return status of
syscalls. -z and -Z become aliases for -e status=successful and -e
status=failed. Staged output is only enabled when at least one status
is filtered, that is, when the set is incomplete.
* signal.c (popcount32): Move ...
* defs.h (popcount32): ... here.
(not_failing_only, failing_only): Remove.
* filter_qualify.c (status_set): New number_set variable.
(statuses): New variable for names of statuses.
(statusstr_to_uint, qualify_status): New functions.
(qual_options): Handle status qualifier.
* number_set.c (get_number_setbit, is_complete_set): New functions.
* number_set.h (is_complete_set): New prototype.
(status_t): New enumeration for statuses.
(status_set): New prototype.
* strace.1.in: Document new status qualifier.
* strace.c (not_failing_only, failing_only): Remove.
(droptcb): Handle status=detached option.
(init): Handle new status qualifier, set status_set variable on -z and -Z
options, warn on -zZ and -Zz, use is_complete_set.
(maybe_switch_tcbs): Reopen memstream after tcb switch.
(print_event_exit): Handle status=unfinished option.
* syscall.c (syscall_entering_trace): Use is_complete_set.
(syscall_exiting_trace): Use is_complete_set, handle status=unavailable
option.
* NEWS: Mention this change.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Paul Chaignon [Sat, 15 Jun 2019 05:21:44 +0000 (07:21 +0200)]
Stage output for -z and -Z options
-z and -Z options print only successful and failing syscalls respectively.
However, failure of syscall is only known after syscall return. Thus, we
end up with something like this on, e.g., ENOENT:
open("does_not_exist", O_RDONLY <unfinished ...>
whereas the intended result is that the open(...) line is not shown at all.
This change fixes this issue using open_memstream. When either the -z or
the -Z option is used, the output is staged in memory (using
open_memstream) until we know the syscall return status. If the
open_memstream function is not available, these new options error out.
Document -z and -Z options as new features since they have never worked
properly before and were undocumented since commit v4.4.95~21.
* stage_output.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* configure.ac (AC_CHECK_FUNCS): Add open_memstream.
* defs.h (struct tcb): Add real_outf, memfptr, and memfloc fields for
memstream.
(strace_open_memstream, strace_close_memstream): New prototypes.
* strace.1.in: Document -z and -Z options.
* strace.c (usage): Mention -z and -Z options.
(init): Error on -z and -Z options if open_memstream if unavailable.
(maybe_switch_tcbs): Handle switch of memstream between tcbs.
(printleader): Avoid marking staged syscalls as unfinished.
* syscall.c (syscall_entering_trace): Open memstream.
(syscall_exiting_trace): Filter failed syscalls if failing_only is set,
handle raw(tcp) case.
(print_syscall_resume): Avoid marking staged syscalls as resumed.
* NEWS: Mention this change.
Paul Chaignon [Mon, 1 Apr 2019 20:26:00 +0000 (22:26 +0200)]
Add -Z option to print only failing syscalls
Existing -z option prints only successful syscalls.
This change adds a -Z option to print only failing syscalls.
Both options will start to behave properly with the subsequent commit.
* strace.c (init): Handle new -Z option.
* defs.h (failing_only): New prototype.
* syscall.c (failing_only): New variable.
(syscall_exiting_trace): Ignore failed syscalls if failing_only is set.
References: https://github.com/strace/strace/issues/50 Co-Authored-by: Burkhard Kohl <burkhard.kohl@intel.com> Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
In file included from statx.c:44:
xstatx.c:47:16: error: ‘struct libc_statx’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
* tests/xstatx.c (struct statx): New forward declaration.
Change maybe_switch_tcbs to return NULL when no switching is necessary.
Introduce maybe_switch_current_tcp as a thing wrapper around
maybe_switch_tcbs.
* strace.c (maybe_switch_current_tcp): New function.
(dispatch_event): Use it instead of maybe_switch_tcbs, move comments
and the os_release check before maybe_switch_tcbs invocation ...
(maybe_switch_tcbs): ... here. Change return value to NULL
if no switching was performed.
tests: robustify strace -k tests against link-time optimizer
Some distributions enable by default a link-time optimizer that
mangles stack_fcall sample executables in a way that renders them
unusable for test purposes.
Robustify tests to defeat link-time optimizer.
* tests/stack-fcall.h (f0, f1, f2, f3): Add second parameter.
* tests/stack-fcall.c (main): Pass main as the second parameter to f0.
* tests/stack-fcall-0.c (f0): Add second parameter f, pass the xor of it
and f0 to f1.
* tests/stack-fcall-1.c (f1): Add second parameter f, pass the xor of it
and f1 to f2.
* tests/stack-fcall-2.c (f2): Add second parameter f, pass the xor of it
and f2 to f3.
* tests/stack-fcall-3.c: Include <asm/unistd.h>.
(f3): Add second parameter f, invoke __NR_gettid syscall with the xor
of f and f3 as its argument.
tests: check decoding of mode argument of mbind and set_mempolicy syscalls
* tests/mbind.c: Include "scno.h".
(errstr): New variable.
(k_mbind): New function.
(out_str): New macro.
(mpol_modes): New array.
(main): Use it and k_mbind.
* tests/set_mempolicy.c: Include "scno.h", do not include <errno.h>,
"xlat.h" and "xlat/mpol_modes.h".
(errstr): New variable.
(k_set_mempolicy): New function.
(out_str): New macro.
(mpol_modes): New array.
(print_nodes): Use it and k_set_mempolicy.
(main): Likewise.
* tests/mbind-Xabbrev.c: New file.
* tests/mbind-Xraw.c: Likewise.
* tests/mbind-Xverbose.c: Likewise.
* tests/set_mempolicy-Xabbrev.c: Likewise.
* tests/set_mempolicy-Xraw.c: Likewise.
* tests/set_mempolicy-Xverbose.c: Likewise.
* tests/gen_tests.in (mbind-Xabbrev, mbind-Xraw, mbind-Xverbose,
set_mempolicy-Xabbrev, set_mempolicy-Xraw, set_mempolicy-Xverbose):
New entries.
* tests/pure_executables.list: Add mbind-Xabbrev, mbind-Xraw,
mbind-Xverbose, set_mempolicy-Xabbrev, set_mempolicy-Xraw,
and set_mempolicy-Xverbose.
* tests/.gitignore: Likewise.
numa: enhance decoding of mode argument of mbind and set_mempolicy syscalls
Implement decoding of memory policy mode flags introduced by Linux
kernel commits v2.6.26-rc1~990 and v2.6.26-rc1~988.
* xlat/mpol_mode_flags.in: New file.
* numa.c: Include "xlat/mpol_mode_flags.h".
(print_mode): Print MPOL_MODE_FLAGS part of mode argument as flags.
* NEWS: Mention this.
sparc, sparc64: refactor arch_set_error and arch_set_success
* linux/sparc/set_error.c (sparc_set_o0_psr): New function.
(arch_set_error, arch_set_success): Use it.
* linux/sparc64/set_error.c (sparc64_set_o0_tstate): New function.
(arch_set_error, arch_set_success): Use it.
sparc, sparc64: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use
When PTRACE_GET_SYSCALL_INFO is in use on sparc, psr is not loaded,
so it has to be loaded explicitly before tampering.
Likewise, when PTRACE_GET_SYSCALL_INFO is in use on sparc64, tstate
is not loaded, so it has to be loaded explicitly before tampering.
* linux/sparc/set_error.c (arch_set_error, arch_set_success): Explicitly
call get_regs before changing psr when PTRACE_GET_SYSCALL_INFO is in use.
* linux/sparc64/set_error.c (arch_set_error, arch_set_success):
Explicitly call get_regs before changing tstate when
PTRACE_GET_SYSCALL_INFO is in use.
* NEWS: Mention this fix.
powerpc: fix syscall tampering when PTRACE_GET_SYSCALL_INFO is in use
When PTRACE_GET_SYSCALL_INFO is in use, CCR is not loaded, so it has
to be loaded explicitly before tampering.
* linux/powerpc/set_error.c (arch_set_error, arch_set_success):
Explicitly load CCR before changing it when PTRACE_GET_SYSCALL_INFO
is in use.
* NEWS: Mention this fix.
* xlat/bpf_attach_type.in (BPF_CGROUP_SYSCTL): New constant introduced
by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
(BPF_CGROUP_UDP4_RECVMSG, BPF_CGROUP_UDP6_RECVMSG): New constants
introduced by Linux kernel commit v5.2-rc6~33^2~44^2^2~5.
* xlat/bpf_commands.in (BPF_MAP_FREEZE): New constant introduced
by Linux kernel commit v5.2-rc1~133^2~193^2~12^2~12.
* xlat/bpf_map_flags.in (BPF_F_RDONLY_PROG, BPF_F_WRONLY_PROG): New
constants introduced by Linux kernel commit
v5.2-rc1~133^2~193^2~12^2~13.
* xlat/bpf_map_types.in (BPF_MAP_TYPE_SK_STORAGE): New constant
introduced by Linux kernel commit v5.2-rc1~133^2~80^2^2~6.
* xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_SYSCTL): New constant
introduced by Linux kernel commit v5.2-rc1~133^2~132^2~39^2~19.
(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE): New constant introduced
by Linux kernel commit v5.2-rc1~133^2~80^2~1^2~4.
* NEWS: Mention this.
* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks,
BPF_PROG_QUERY_checks): Update.
* tests/kernel_version.c (print_bpf_attr): Update.
Dmitry V. Levin [Thu, 27 Jun 2019 16:51:33 +0000 (16:51 +0000)]
print_dirfd: do not print trailing comma
It was fine to print trailing comma in print_dirfd until introduction
of a syscall with the last argument being a dirfd.
Now it's time to change print_dirfd.
Dmitry V. Levin [Wed, 26 Jun 2019 08:00:39 +0000 (08:00 +0000)]
mips: refactor syscallent initializers
Change format of designated initializers to BASE_NR + offset.
* linux/mips/syscallent-n32.h (BASE_NR): New macro. Use it in designated
initializers.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.