| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/.gitignore: Add lua.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(LUAJIT_TESTS): New variable.
(TESTS): Add LUAJIT_TESTS.
(EXTRA_DIST): Add lua.sh, lua-basics.test, lua-qual.test,
lua-tampering.test.
* tests/lua-basics.test: New file.
* tests/lua-qual.test: Likewise.
* tests/lua-tampering.test: Likewise.
* tests/lua.c: Likewise.
* tests/lua.sh: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: check for process_vm_writev's availability.
* defs.h: Add declaration for upoken.
* luajit.h (func_upoke): New wrapper function.
(init_luajit): Expose it as strace.C.upoke.
* luajit_lib.lua (write_obj): New function.
* strace.1 (LUA SCRIPTING): Describe new functions.
* ucopy.c (process_vm_writev_not_supported): New global flag.
(strace_process_vm_writev): New function.
(vm_write_mem): Likewise.
(partial_poke): Likewise.
(upoken_peekpoke): Likewise.
(upoken): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* .gitignore: Add luajit_lib.h.
* Makefile.am: Build with LuaJIT if configured so.
(luajit_lib.h): Auto-generate from luajit_lib.lua.
* NEWS: New entry.
* configure.ac: Add new --with-luajit configure option.
* defs_shared.h (struct tcb): If built with LuaJIT support, include
currpers field even if SUPPORTED_PERSONALITIES is 1.
If built with LuaJIT support, add new ad_hoc_inject_data field.
* filter_qualify.c: (hook_entry_set, hook_exit_set): New sets (if built
with LuaJIT support).
* luajit.h: New file.
* luajit_lib.h: Likewise.
* strace.1.in (LUA SCRIPTING): New section.
* strace.c (alloctcb): update the condition of presence of currpers
field.
(init): New -l option (if built with LuaJIT support).
(main): run Lua script, if built with LuaJIT support and a script
was provided.
* syscall.c (tcb_inject_data): If built with LuaJIT support and, blend
the result with tcp's ad_hoc_inject_data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.am (strace_SOURCES): Add defs_shared.h and ffi.h.
* basic_filters.c (syscall_classes): make global and terminate by a
null entry.
(lookup_class): use global null entry-terminated variable.
* defs.h (TCB_AD_HOC_INJECT, TCB_HOOK): New TCB flags.
(QUAL_HOOK_ENTRY, QUAL_HOOK_EXIT): New qualifier flags.
(RVAL_HOOKED): New return value flag.
(struct ioctlent, struct tcb): move to...
* defs_shared.h: ...new file.
* ffi.h: New file.
* filter_qualify.c (qual_flags): Introduce QUALBIT macro and use it.
* number_set.c (number_unsetbit, remove_number_from_set,
extend_set_with_number, make_number_set_universal,
extend_set_array_with_number, make_number_set_array_universal): New
functions.
* strace.c (enum trace_event): Introduce new TE_SYSCALL_STOP_HOOK_EXIT
trace event.
(enum hook_state): New enumeration.
(trace_syscall): Add a hook state argument.
(dispatch_event): Add a "hooked" argument, support invoking with
TE_SYSCALL_STOP_HOOK_EXIT event.
* syscall.c: (errnoent_vec, nerrnoent_vec, signalent_vec,
nsignalent_vec, ioctlent_vec, nioctlent_vec, personality_wordsize,
personality_klongsize, personality_names): New global variables.
(update_personality): Use personality_names for reporting personality
name.
(tcb_inject_opts): Introduce step argument, change return type to struct
inject_data, rename to tcb_inject_data.
(tamper_with_syscall_entering): Don't copy inject_vec here and do
counter decrement logic here; pass true as a second argument to
tcb_inject_data.
(tamper_with_syscall_exiting): Pass false as a second argument to
tcb_inject_data.
(syscall_ad_hoc_inject): New function.
(syscall_entering_trace): Perform ad hoc injection even if the syscall
is not traced.
(syscall_exiting_decode): Don't return 0 ("bail out") if exiting hook is
set up for this syscall, or if an ad hoc injection was performed.
Call tamper_with_syscall_exiting on success.
(syscall_exiting_trace): Don't call tamper_with_syscall_exiting, check
if the syscall is not traced again.
(syscall_exiting_finish): Clear TCB_AD_HOC_INJECT bit.
* sysent.h: Modify to support inclusing with FFI_CDEF defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uClibc-ng declares program_invocation_name as const.
This causes the build failure below:
error_prints.c:40:14: error: conflicting types for ‘program_invocation_name’
extern char *program_invocation_name;
^~~~~~~~~~~~~~~~~~~~~~~
In file included from error_prints.c:32:0:
.../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of ‘program_invocation_name’ was here
extern const char *program_invocation_name, *program_invocation_short_name;
^~~~~~~~~~~~~~~~~~~~~~~
* error_prints.c (program_invocation_name): Declare only in case
of [!HAVE_PROGRAM_INVOCATION_NAME].
|
|
|
|
|
| |
* rtnl_tc_action.c (tcamsg_nla_decoders): New array.
(decode_tcamsg): Use it.
|
|
|
|
|
|
|
|
| |
* tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro.
* tests/nlattr_tca_stab.c: New file.
* tests/gen_tests.in (nlattr_tca_stab): New entry.
* tests/pure_executables.list: Add nlattr_tca_stab.
* tests/.gitignore: Likewise.
|
|
|
|
|
|
|
| |
* tests/nlattr_tc_stats.c: New file.
* tests/gen_tests.in (nlattr_tc_stats): New entry.
* tests/pure_executables.list: Add nlattr_tc_stats.
* tests/.gitignore: Likewise.
|
|
|
|
|
| |
* tests/nlattr_tcmsg.c: Include <stddef.h> and <linux/pkt_sched.h>.
(main): Check decoding of TCA_STATS and TCA_RATE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic,
gnet_stats_queue, gnet_stats_rate_est,
and gnet_stats_rate_est64 structures in <linux/gen_stats.h>.
And check for struct tc_sizespec in <linux/pkt_sched.h>.
* nlattr.h (tc_stats): New prototype.
* rtnl_tc.c: Include <linux/gen_stats.h>, <linux/pkt_sched.h>,
"xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h".
(decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic,
decode_gnet_stats_rate_est, decode_gnet_stats_queue,
decode_gnet_stats_rate_est64, decode_nla_tc_stats,
decode_tc_sizespec, print_stab_data, decode_tca_stab_data,
decode_tca_stab): New functions.
(tca_stats_nla_decoders, tca_stab_nla_decoders,
tcmsg_nla_decoders): New arrays.
(decode_tcmsg): Use tcmsg_nla_decoders.
* xlat/rtnl_tca_stab_attrs.in: New file.
* xlat/rtnl_tca_stats_attrs.in: Likewise.
|
|
|
|
|
| |
* xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT.
* NEWS: Mention this.
|
|
|
|
|
| |
* xlat/socketlayers.in: Add SOL_TLS.
* NEWS: Mention this.
|
|
|
|
|
|
| |
* NEWS: Add a header line for the next release.
* debian/changelog.in: Add a changelog entry for 4.19-1.
* strace.spec.in: Likewise.
|
|
|
|
| |
* NEWS: Update for 4.19 release.
|
|
|
|
|
| |
* .mailmap: Add canonical name and address of Edgar Kaziakhmedov here
to avoid duplications in CREDITS file.
|
|
|
|
| |
* maint/gen-tag-message.sh: New file.
|
|
|
|
| |
* maint/gen-contributors-list.sh: New file.
|
|
|
|
|
|
| |
Headers updated automatically with
maint/update_copyright_headers.sh -c
|
|
|
|
|
|
|
| |
* maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE,
GIT_COMMIT_MESSAGE): New variables.
<-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string
as a template.
|
|
|
|
|
|
|
|
|
| |
In order to provide better diagnostics.
* configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as
1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro.
Closes: https://github.com/strace/strace/issues/11
|
| |
|
|
|
|
|
|
|
| |
* tests/nlattr_ifla_xdp.c: New file.
* tests/gen_tests.in (nlattr_ifla_xdp): New entry.
* tests/pure_executables.list: Add nlattr_ifla_xdp.
* tests/.gitignore: Likewise.
|
|
|
|
|
|
|
| |
* tests/nlattr_ifla_port.c: New file.
* tests/gen_tests.in (nlattr_ifla_port): New entry.
* tests/pure_executables.list: Add nlattr_ifla_port.
* tests/.gitignore: Likewise.
|
|
|
|
|
|
| |
* tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS,
IFLA_INFO_KIND, IFLA_VF_PORT): New macros.
(main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi
in <linux/if_link.h>.
* rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h",
"xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h",
"xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h".
(decode_ifla_linkinfo, decode_ifla_port_vsi,
decode_ifla_port, decode_ifla_vf_ports,
decode_ifla_xdp_flags, decode_ifla_xdp): New functions.
(ifla_linkinfo_nla_decoders, ifla_port_nla_decoders,
ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays.
(ifinfomsg_nla_decoders) <IFLA_LINKINFO>: Use decode_ifla_linkinfo.
<IFLA_VF_PORTS>: Use decode_ifla_vf_ports.
<IFLA_PORT_SELF>: Use decode_ifla_port.
<IFLA_XDP>: Use decode_ifla_xdp.
* xlat/rtnl_ifla_info_attrs.in: New file.
* xlat/rtnl_ifla_port_attrs.in: Likewise.
* xlat/rtnl_ifla_vf_port_attrs.in: Likewise.
* xlat/rtnl_ifla_xdp_attrs.in: Likewise.
* xlat/xdp_flags.in: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fetch_struct_keyctl_kdf_params.c: New file.
* keyctl_kdf_params.h: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* configure.ac: Add check for struct keyctl_kdf_params presence in
<linux/keyctl.h>.
* defs.h (struct strace_keyctl_kdf_params): Add forward declaration.
* keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it
on exiting.
(SYS_FUNC(keyctl)) <case KEYCTL_DH_COMPUTE>: Pass arg5 to
keyctl_dh_compute.
* tests/keyctl.c: Include assert.h.
(struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New
definition.
(STR32): New definition, copied from ioctl_dm.c.
(append_str, kckdfp_to_str): New functions.
(main): Update expected output, add checks for struct keyctl_kdf_params
decoding.
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/keyctl.c: Since do_keyctl() has so convoluted calling convention
and keyctl test is so complex, let's try to improve readability a bit
with some conventions regarding do_keyctl() call formatting: arguments
representing single keyctl argument should be put on the separate line,
continuations of arguments related to the same keyctl argument should
have additional indentation and termination 0UL should always be
on a separate line. Also, while we are here, let's add spaces
to two type casts that are missing them.
|
|
|
|
| |
* linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh.
|
|
|
|
|
|
| |
* mpers.awk (what_is): Remove returned_size from local variables.
Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently")
|
|
|
|
|
|
|
|
|
|
| |
Enhance runtime detection of struct rtnl_link_stats.rx_nohandler
and struct rtnl_link_stats64.rx_nohandler.
* rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats).
(decode_rtnl_link_stats64): Likewise, so not accept structure length
greater than min_size but less than sizeof(struct rtnl_link_stats64).
|
|
|
|
|
|
|
|
|
| |
Add support of kernels that operate with older definition of
struct ndt_stats than the definition used to build strace.
* rtnl_neightbl.c (decode_ndt_stats): Add runtime detection
of struct ndt_stats.ndts_table_fulls field, print the field
when it is available.
|
|
|
|
|
|
|
|
| |
* tests/nlattr_ifla_brport.c: New file.
* tests/gen_tests.in (nlattr_ifla_brport): New entry.
* tests/pure_executables.list: Add nlattr_ifla_brport.
* tests/.gitignore: Likewise.
* tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro.
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id
and rtnl_link_stats64 structures in <linux/if_link.h>.
* rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h".
(decode_ifla_bridge_id, decode_ifla_protinfo): New functions.
(ifla_brport_nla_decoders): New array.
(ifinfomsg_nla_decoders) <IFLA_PROTINFO>: Use decode_ifla_protinfo.
* xlat/rtnl_ifla_brport_attrs.in: New file.
|
|
|
|
|
| |
* tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros.
(main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS.
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_TYPES): Check for ndt_config
and ndt_stats structures in <linux/neighbour.h>.
(AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats.
* rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h".
(decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions.
(ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays.
(decode_ndtmsg): Use ndtmsg_nla_decoders.
* xlat/rtnl_neightbl_parms_attrs.in: New file.
|
|
|
|
| |
* tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS.
|
|
|
|
|
|
| |
* rtnl_addrlabel.c (decode_ifal_address): New function.
(ifaddrlblmsg_nla_decoders): New array.
(decode_ifaddrlblmsg): Use it.
|
|
|
|
| |
* linux/alpha/syscallent.h [514..522]: New entries.
|
|
|
|
| |
* tests/.gitignore: Add is_linux_mips_n64.
|
|
|
|
|
|
| |
* mpers.awk (compare_indices): Make c1 and c2 variables local.
(enter): Make item variable local.
(what_is): Make loc_diff, returned_size, and to_return local.
|
|
|
|
|
| |
* mpers.awk (array_get, update_upper_bound): Separate local variables
from real parameters by newline.
|
|
|
|
|
|
|
|
|
|
| |
The attribute of FRA_TABLE is not just a 32-bit integer, some constants
have well-known symbolic names like RT_TABLE_DEFAULT.
* rtnl_rule.c (fib_rule_hdr_nla_decoders) <FRA_TABLE>:
Use decode_nla_rt_class.
* tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro.
(main): Check FRA_TABLE decoding.
|
|
|
|
|
|
|
|
|
|
| |
The attribute of RTA_TABLE is not just a 32-bit integer, some constants
have well-known symbolic names like RT_TABLE_DEFAULT.
* nlattr.h (decode_nla_rt_class): New prototype.
* rtnl_route.c (decode_nla_rt_class): New function.
(rtmsg_nla_decoders) <RTA_TABLE>: Use it.
* tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding.
|
|
|
|
|
| |
* rtnl_nsid.c (rtgenmsg_nla_decoders): New array.
(decode_rtgenmsg): Use it.
|
|
|
|
|
| |
* rtnl_netconf.c (netconfmsg_nla_decoders): New array.
(decode_netconfmsg): Use it.
|
|
|
|
|
|
| |
* tests/nlattr_ndmsg.c: Include <netinet/in.h> and <arpa/inet.h>.
(NDA_PORT): New macro.
(main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT.
|
|
|
|
|
|
|
|
|
|
| |
* nlattr.c: Include <netinet/in.h> and <arpa/inet.h>.
(decode_nla_be16): New function.
* nlattr.h (decode_nla_be16): New prototype.
* rtnl_neigh.c (decode_neigh_addr,
decode_nda_cacheinfo): New functions.
(ndmsg_nla_decoders): New array.
(decode_ndmsg): Use it.
|
|
|
|
|
|
| |
* tests/nlattr_fib_rule_hdr.c: Include <inttypes.h>.
(FRA_TUN_ID, FRA_UID_RANGE): New macros.
(main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_CHECK_FUNCS): Add be64toh.
(AC_CHECK_TYPES): Check for struct fib_rule_uid_range
in <linux/fib_rules.h>.
* nlattr.c: Include <endian.h>.
(decode_nla_be64): New function.
* nlattr.h (decode_nla_be64): New prototype.
* rtnl_rule.c (decode_rule_addr,
decode_fib_rule_uid_range): New functions.
(fib_rule_hdr_nla_decoders): New array.
(decode_fib_rule_hdr): Use it.
|
|
|
|
|
|
|
|
| |
* defs.h (routing_types): New xlat prototype.
* rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode.
* xlat/nda_types.in: Remove it.
* tests/netlink_route.c (test_rtnl_neigh): Update the test.
* tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise.
|