Nikolay Marchuk's GSoC status report - #8 of 13

2017-07-25 Thread Nikolay Marchuk
Hello, strace community! Project: Advanced syscall filtering syntax. Accomplishments: this week I've been working on improvements of fd filtering. Unfortunately, I haven't found good solution for the issue with negative fds, but I've found and fixed other issues of fd filtering. In my opinion, t

JingPiao Chen's GSoC status report - #8 of 13

2017-07-25 Thread JingPiao Chen
Hello, strace community! Project: Netlink socket parsers. Accoplisment: * fixed NETLINK_CRYPTO: Use PRINT_FIELD_* and TEST_NETLINK macros. * fixed NETLINK_AUDIT: Likewise. * prepare for NETLINK_KOBJECT_UEVENT decode: Call get_fd_nl_family before decode nlmsghdr. * print all NETLINK_KOBJECT_UEVENT

Re: Nikolay Marchuk's GSoC status report - #8 of 13

2017-07-25 Thread Eugene Syromiatnikov
On Tue, Jul 25, 2017 at 06:26:06PM +0700, Nikolay Marchuk wrote: > Hello, strace community! > > Project: Advanced syscall filtering syntax. > > > Accomplishments: this week I've been working on improvements of fd > filtering. Unfortunately, I haven't found good solution for the issue > with nega

Re: JingPiao Chen's GSoC status report - #8 of 13

2017-07-25 Thread Dmitry V. Levin
Hi, On Tue, Jul 25, 2017 at 07:46:04PM +0800, JingPiao Chen wrote: > Hello, strace community! > > Project: Netlink socket parsers. > > Accoplisment: > * fixed NETLINK_CRYPTO: Use PRINT_FIELD_* and TEST_NETLINK macros. > * fixed NETLINK_AUDIT: Likewise. > * prepare for NETLINK_KOBJECT_UEVENT deco

Re: JingPiao Chen's GSoC status report - #8 of 13

2017-07-25 Thread JingPiao Chen
On Tue, Jul 25, 2017 at 03:10:17PM +0300, Dmitry V. Levin wrote: > Hi, > > On Tue, Jul 25, 2017 at 07:46:04PM +0800, JingPiao Chen wrote: > > Hello, strace community! > > > > Project: Netlink socket parsers. > > > > Accoplisment: > > * fixed NETLINK_CRYPTO: Use PRINT_FIELD_* and TEST_NETLINK mac

[PATCH 1/3] netlink: call get_fd_nl_family before decode nlmsghdr

2017-07-25 Thread JingPiao Chen
Prepare for NETLINK_KOBJECT_UEVENT decode. The messages of NETLINK_KOBJECT_UEVENT do not contain nlmsghdr. * netlink.c (NL_FAMILY_*): Remove enum. (get_fd_nl_family): Replace NL_FAMILY_ERROR with -1. (decode_nlmsg_type): Correct the comment. Skip family specific type decoders for type < NLMSG_MIN_

[PATCH 3/3] tests: check print NETLINK_KOBJECT_UEVENT buffer in string

2017-07-25 Thread JingPiao Chen
* tests/netlink_kobject_uevent.c: New file. * tests/gen_tests.in (netlink_kobject_uevent): New entry. * tests/pure_executables.list: Add netlink_kobject_uevent. * tests/.gitignore: Likewise. --- tests/.gitignore | 1 + tests/gen_tests.in | 1 + tests/netlink_kobject_uev

[PATCH 2/3] netlink: print all NETLINK_KOBJECT_UEVENT buffer in string

2017-07-25 Thread JingPiao Chen
* netlink.c (decode_netlink): Call printstrn when family == NETLINK_KOBJECT_UEVENT. --- netlink.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/netlink.c b/netlink.c index a853fbd..aaa3e07 100644 --- a/netlink.c +++ b/netlink.c @@ -438,6 +438,12 @@ decode_netlink(struct tcb *const tcp,

[PATCH v9 2/3] Introduce upoken function and expose it to LuaJIT scripts

2017-07-25 Thread Victor Krapivensky
This patch implies that we have process_vm_writev if and only if we have process_vm_readv, and that they are either both supported or both unsupported. * defs.h: Add declaration for upoken. * luajit.h (func_upoke): New wrapper function. (init_luajit): Expose it as strace.upoke. * luajit_lib.lua (w

[PATCH v9 0/3] Add LuaJIT scripting support

2017-07-25 Thread Victor Krapivensky
Victor Krapivensky (3): Initial support for LuaJIT scripting Introduce upoken function and expose it to LuaJIT scripts tests: check LuaJIT scripting support .gitignore | 1 + Makefile.am | 17 +++ configure.ac | 36 + defs.h |

[PATCH v9 1/3] Initial support for LuaJIT scripting

2017-07-25 Thread Victor Krapivensky
* .gitignore: Add luajit_lib.h. * Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_shared.h, ffi.h. (luajit_lib.h): Auto-generate from luajit_lib.lua. * configure.ac: Add new --with-luajit configure option. * defs.h (TCB_AD_HOC_INJECT): new TCB flag. (QUAL_HOOK_ENTRY, QUA

[PATCH v9 3/3] tests: check LuaJIT scripting support

2017-07-25 Thread Victor Krapivensky
* 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-tamperi

Victor Krapivensky's GSoC status report - #8 of 13

2017-07-25 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've written tests checking LuaJIT scripting support. I've also fixed a number of issues pointed out by Eugene Syromyatnikov (e.g. functions that previously took an optional per

Re: [PATCH v4 2/6] Introduce new filtering architecture

2017-07-25 Thread Eugene Syromyatnikov
On Tue, Jul 25, 2017 at 5:19 AM, Nikolay Marchuk wrote: > What indentation should I use? I used DECL_* macros from defs.h as a > reference. After discussion with Dmitry it has been decided that comments after such macro definitions should be put in order to signify their termination, please refer

[PATCH 1/5] netlink: decode NETLINK_ROUTE messages first one byte of family

2017-07-25 Thread JingPiao Chen
All the NETLINK_ROUTE messages first one byte it save family. * netlink_route.c: New file. * Makefile.am (strace_SOURCES): Add it. * defs.h (decode_netlink_route): New prototype. * netlink.c (netlink_decoders): Add NETLINK_ROUTE. Co-authored-by: Fabien Siron --- Makefile.am | 1 + defs.h

[PATCH 0/5] Implement basic protocol specific decoding of NETLINK_ROUTE

2017-07-25 Thread JingPiao Chen
The problem I meet: Need I separate files like NETLINK_SOCK_DIAG? Need I declare decode_family in defs.h or netlink.h? (decode_family is duplicate from netlink_sock_diag) I think they are in two different module, I do not declare decode_family. Please give me some advice of the commit message of

[PATCH 2/5] tests: check decoding of NETLINK_ROUTE messages first one byte

2017-07-25 Thread JingPiao Chen
* tests/netlink_route.c: Include , include "test_netlink.h" instead of "netlink.h". (test_rtnl_unspec): New function. (main): Use it. Co-authored-by: Fabien Siron --- tests/netlink_route.c | 54 ++- 1 file changed, 53 insertions(+), 1 deletion(-)

[PATCH 3/5] Move nl_route_types definition from netlink.c to netlink_route.c

2017-07-25 Thread JingPiao Chen
The side effect of #include "xlat/nl_route_types.h" is RTM_* constants properly defined in that header file. While netlink.c does not use these constants itself, netlink_route.c is going to need them soon. * defs.h (nl_route_types): New xlat prototype. * netlink.c: Move inclusion of "xlat/nl_route

[PATCH 4/5] netlink: add a basic rtnetlink parser of link messages

2017-07-25 Thread JingPiao Chen
* defs.h (arp_hardware_types, iffflags): New xlat prototypes. * netlink_route.c: Include "print_fields.h" and . (decode_ifinfomsg): New function. (netlink_route_decoder_t): New typedef. (route_decoders): New array. (decode_netlink_route): Use it. Co-authored-by: Fabien Siron --- defs.h

[PATCH 5/5] tests: check decoding of rtnetlink link messages

2017-07-25 Thread JingPiao Chen
* tests/netlink_route.c: Include . (TEST_NL_ROUTE): New macro. (test_rtnl_link): New function. (main): Use it. Co-authored-by: Fabien Siron --- tests/netlink_route.c | 61 +++ 1 file changed, 61 insertions(+) diff --git a/tests/netlink_route.c b/t