GSoC 2017 introduction

2017-03-05 Thread Victor Krapivensky
Hi everybody! My name is Victor Krapivensky and I am a first-year student at MIPT. I want to implement Lua-scriptable advanced syscall tampering for strace. I am quite fluent in C, have an interest in system programming and debugging, and have good understanding of how Lua C API works. I have

Re: GSoC 2017 introduction

2017-03-09 Thread Victor Krapivensky
o, how do I get syscall numbers for all the platforms? On 03/07/2017 01:10 AM, Dmitry V. Levin wrote: Hi Victor, > > On Sun, Mar 05, 2017 at 06:31:31PM +0300, Victor Krapivensky wrote: >> Hi everybody! My name is Victor Krapivensky and I am a first-year >> student at MIPT. >>

Re: GSoC 2017 introduction

2017-03-09 Thread Victor Krapivensky
tests because of this -- oops!) >From e8754de2791ddb6c79fd51a49c83582c9d9a01d7 Mon Sep 17 00:00:00 2001 From: Victor Krapivensky Date: Thu, 9 Mar 2017 20:26:14 +0300 Subject: [PATCH v2] Add support for statx syscall --- Makefile.am | 1 + linux/32/syscallent.h | 1

Re: GSoC 2017 introduction

2017-03-10 Thread Victor Krapivensky
happens to be negative. [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h#n45 >From c6f6914254aad88baa98c89d6a955fa8189822ca Mon Sep 17 00:00:00 2001 From: Victor Krapivensky Date: Thu, 9 Mar 2017 20:26:14 +0300 Subject: [PATCH v3] Add suppo

Re: GSoC 2017 introduction

2017-03-11 Thread Victor Krapivensky
Removed a trailing semicolon in a macro definition in tests/xstatx.c and changed copyright holders of new files to "The strace developers". Please review this one. I've also found a possile buffer overflow bug in unwind.c. Attaching a separate patch. On 03/10/2017 09:59 PM, Vic

[PATCH v5] Implement decoding of statx syscall

2017-03-15 Thread Victor Krapivensky
* Makefile.am (strace_SOURCES): Add statx.c and stat.h. * linux/i386/syscallent.h: Add statx entry. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. * pathtrace.c (pathtrace_match): Handle SEN_statx. * statx.c: New file. * statx.h: Likewise. * tests/.gitignore: Add statx.

[PATCH] Decode RUSAGE_THREAD

2017-03-15 Thread Victor Krapivensky
* xlat/usagewho.in: Add RUSAGE_THREAD. * tests/getrusage.c: Test decoding of RUSAGE_THREAD. --- tests/getrusage.c | 21 +++-- xlat/usagewho.in | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/getrusage.c b/tests/getrusage.c index 8b76eff..ba1a7ef 10064

[PATCH v2] Decode RUSAGE_THREAD

2017-03-15 Thread Victor Krapivensky
* xlat/usagewho.in: Add values for existing values, add RUSAGE_THREAD. * tests/getrusage.c: Test decoding of RUSAGE_THREAD. --- tests/getrusage.c | 31 +-- xlat/usagewho.in | 7 --- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/tests/getrusage.c

[PATCH v3] Decode RUSAGE_THREAD

2017-03-16 Thread Victor Krapivensky
* xlat/usagewho.in: Add values for existing entities, add RUSAGE_THREAD. * tests/getrusage.c: Test decoding of RUSAGE_THREAD. --- tests/getrusage.c | 31 +-- xlat/usagewho.in | 7 --- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/tests/getrusage.

Re: [PATCH v5] Implement decoding of statx syscall

2017-03-17 Thread Victor Krapivensky
On Thu, Mar 16, 2017 at 04:27:26AM +0300, Dmitry V. Levin wrote: > This blank line at the end has caused this "git am" response: > > Applying: Implement decoding of statx syscall > .git/rebase-apply/patch:385: new blank line at EOF. > + > fatal: 1 line adds whitespace errors. > Patch failed at 000

[PATCH v6] Implement decoding of statx syscall

2017-03-17 Thread Victor Krapivensky
* linux/i386/syscallent.h [383]: Add statx entry. * linux/x32/syscallent.h [332]: Likewise. * linux/x86_64/syscallent.h [332]: Likewise. * pathtrace.c (pathtrace_match): Handle SEN_statx. * statx.c: New file. * statx.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * tests/.gitignore: Add sta

[PATCH v7] Implement decoding of statx syscall

2017-03-17 Thread Victor Krapivensky
* linux/i386/syscallent.h [383]: Add statx entry. * linux/x32/syscallent.h [332]: Likewise. * linux/x86_64/syscallent.h [332]: Likewise. * pathtrace.c (pathtrace_match): Handle SEN_statx. * statx.c: New file. * statx.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * tests/.gitignore: Add sta

Re: [PATCH v7] Implement decoding of statx syscall

2017-03-18 Thread Victor Krapivensky
On Sat, Mar 18, 2017 at 04:00:50AM +0300, Dmitry V. Levin wrote: > I suggest placing AT_STATX_SYNC_TYPE before AT_STATX_FORCE_SYNC > so we could use printflags. I don't see any sense in that: AT_STATX_{SYNC_AS_STAT,FORCE_SYNC,DONT_SYNC} are mutually exclusive, and statx called with flags=AT_STATX_

Re: [PATCH v6] Implement decoding of statx syscall

2017-03-18 Thread Victor Krapivensky
On Sat, Mar 18, 2017 at 10:44:09AM +0100, Eugene Syromyatnikov wrote: > I haven't look at v7 of the patch yet, but coverage [1] shows that at least > this line is not covered by the test. The version of the patch you run coverage on is very old (it still has reserved2 field of struct_statx of size

[PATCH v8] Implement decoding of statx syscall

2017-03-18 Thread Victor Krapivensky
* linux/i386/syscallent.h [383]: Add statx entry. * linux/x32/syscallent.h [332]: Likewise. * linux/x86_64/syscallent.h [332]: Likewise. * pathtrace.c (pathtrace_match): Handle SEN_statx. * statx.c: New file. * statx.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * tests/.gitignore: Add sta

Re: [PATCH v8] Implement decoding of statx syscall

2017-03-18 Thread Victor Krapivensky
Oops. Just realized that ~STATX_ALL and ~STATX_NLINK produce platform-dependent values. Please ignore v8 and review v9 instead. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashd

[PATCH v9] Implement decoding of statx syscall

2017-03-18 Thread Victor Krapivensky
* linux/i386/syscallent.h [383]: Add statx entry. * linux/x32/syscallent.h [332]: Likewise. * linux/x86_64/syscallent.h [332]: Likewise. * pathtrace.c (pathtrace_match): Handle SEN_statx. * statx.c: New file. * statx.h: Likewise. * Makefile.am (strace_SOURCES): Add them. * tests/.gitignore: Add sta

[RFC] GSoC 2017 proposal draft: advanced syscall tampering and filtering with Lua

2017-03-25 Thread Victor Krapivensky
The first draft of my proposal can be found here: https://gist.github.com/shdown/a1f3f2bce1210f55389bacf406030b25 As for now, it is incomplete (does not even contain schedule) and will surely be updated and enhanced later. Please provide some feedback. --

Re: [RFC] GSoC 2017 proposal draft: advanced syscall tampering and filtering with Lua

2017-03-30 Thread Victor Krapivensky
On Thu, Mar 30, 2017 at 05:28:55AM +0200, Eugene Syromyatnikov wrote: > The one quite interesting aspect, from my point of view, is the way you > expect to access (and modify) argument data. For example, some syscalls > (like sendmsg or evdev/dm ioctls or siginfo-related ones) have quite > non-triv

Re: [PATCH v9] Implement decoding of statx syscall

2017-04-15 Thread Victor Krapivensky
On Wed, Apr 12, 2017 at 04:28:19PM +0300, Dmitry V. Levin wrote: > Linux commit v4.11-rc6~5^2^2~1 has added STATX__RESERVED bit. Should we actually do something about this one? Also, it is OK that linux/xtensa/syscallent.h does not contain entries for syscalls 348...350 (pkey_{mprotect,alloc,fre

[PATCH] Adjust statx parser and syscall entries lists to the upstream

2017-04-15 Thread Victor Krapivensky
* linux/32/syscallent.h [291]: Add statx entry. * linux/64/syscallent.h [291]: Likewise. * linux/arm/syscallent.h [397]: Likewise. * linux/m68k/syscallent.h [379]: Likewise. * linux/mips/syscallent-n32.h [6330]: Likewise. * linux/mips/syscallent-n64.h [5326]: Likewise. * linux/mips/syscallent-o32.h

Re: Conflicting projects.

2017-05-13 Thread Victor Krapivensky
On Fri, May 12, 2017 at 05:12:38PM +0200, Eugene Syromiatnikov wrote: > They are not in conflict, from my point of view, since your project is > about the way specific syscall is selected for processing by strace, > and Victor's project is about how that processing is done. Granted, this > processi

[PATCH] strace.c: split trace() into next_event()/dispatch_event()

2017-05-14 Thread Victor Krapivensky
This is a preparation needed to implement a pull-style API for LuaJIT. --- strace.c | 336 +-- 1 file changed, 198 insertions(+), 138 deletions(-) diff --git a/strace.c b/strace.c index aee2097..10fa1bf 100644 --- a/strace.c +++ b/strace

Re: [PATCH] strace.c: split trace() into next_event()/dispatch_event()

2017-06-01 Thread Victor Krapivensky
On Wed, May 31, 2017 at 06:58:07PM +0300, Dmitry V. Levin wrote: > I'm very much in favour of this change, it makes the control flow easier > to understand. Technically, this patch looks correct, although I've spend > a lot of my reviewing time to get to this conclusion. Next time when you > do r

[PATCH v2] strace.c: split trace() into next_event()/dispatch_event()

2017-06-01 Thread Victor Krapivensky
This is a preparation needed to implement a pull-style API for LuaJIT. --- strace.c | 351 ++- 1 file changed, 211 insertions(+), 140 deletions(-) diff --git a/strace.c b/strace.c index 42650ab..0d3c8e9 100644 --- a/strace.c +++ b/strace

[PATCH v3] strace.c: refactor trace into two functions

2017-06-02 Thread Victor Krapivensky
This change decouples waiting for next event from reacting to it. This makes the control flow easier to understand, and serves as a preparation for implementing a pull-style API for LuaJIT. * strace.c (enum trace_event): New enum. (trace): Split into... (next_event, dispatch_event): ...new functio

[PATCH v1 0/2] Further preparations for implementing pull-style API

2017-06-03 Thread Victor Krapivensky
Victor Krapivensky (2): syscall.c: split trace_syscall() into 5 functions strace.c: move termination code to a separate function defs.h| 21 strace.c | 50 -- syscall.c | 82

[PATCH v1 1/2] syscall.c: split trace_syscall() into 5 functions

2017-06-03 Thread Victor Krapivensky
This change removes the trace_syscall function. Now, the code that uses syscall.c trace functions is expected to check whether it is a syscall entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make an appropriate sequence of function calls. * defs.h: Change comment on TCB_INSYSCALL,

[PATCH v1 2/2] strace.c: move termination code to a separate function

2017-06-03 Thread Victor Krapivensky
This will be needed for the pull-style API. * strace.c (terminate): New function. (main): Use it. --- strace.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/strace.c b/strace.c index 55c6fe76..2657bcf7 100644 --- a/strace.c +++ b/strace.c @@

Re: [PATCH v1 1/2] syscall.c: split trace_syscall() into 5 functions

2017-06-05 Thread Victor Krapivensky
On Mon, Jun 05, 2017 at 02:47:41AM +0300, Dmitry V. Levin wrote: > Why "static inline"? Is it important whether the function is actually > inlined or not? If not, no need to insist on inlining. OK, removed "inline". > Why syscall_entering_decode was given this name? It does get_scno, > get_sys

[PATCH v2 1/2] syscall.c: split trace_syscall() into 5 functions

2017-06-05 Thread Victor Krapivensky
This change removes the trace_syscall function. Now, the code that uses syscall.c trace functions is expected to check whether it is a syscall entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make an appropriate sequence of function calls. * defs.h: Change comment on TCB_INSYSCALL,

[PATCH v2 2/2] strace.c: move termination code to a separate function

2017-06-05 Thread Victor Krapivensky
This will be needed for the pull-style API. * strace.c (terminate): New function. (main): Use it. --- strace.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/strace.c b/strace.c index af5fd346..5accb141 100644 --- a/strace.c +++ b/strace.c @@ -2

[PATCH v2 0/2] Further preparations for implementing pull-style API

2017-06-05 Thread Victor Krapivensky
Victor Krapivensky (2): syscall.c: split trace_syscall() into 5 functions strace.c: move termination code to a separate function defs.h| 21 strace.c | 48 +++-- syscall.c | 82

Re: [PATCH v1 1/2] syscall.c: split trace_syscall() into 5 functions

2017-06-05 Thread Victor Krapivensky
On Mon, Jun 05, 2017 at 02:35:23PM +0300, Dmitry V. Levin wrote: > Where are you going to call the exiting hook from? Is it going to happen > before get_regs/get_syscall_result calls or after them? Oops. Yes, it should be called after we decode syscall result, of course. As for naming, I think "

[PATCH v3 1/1] syscall.c: split trace_syscall() into 6 functions

2017-06-05 Thread Victor Krapivensky
This change removes the trace_syscall function. Now, the code that uses syscall.c trace functions is expected to check whether it is a syscall entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make an appropriate sequence of function calls. * defs.h: Change comment on TCB_INSYSCALL,

Re: [PATCH v3 1/1] syscall.c: split trace_syscall() into 6 functions

2017-06-05 Thread Victor Krapivensky
On Mon, Jun 05, 2017 at 06:14:49PM +0300, Dmitry V. Levin wrote: > Your comments tend to be longer than 80 symbols, please wrap them. > > Note that in this edition of the patch TCB_INSYSCALL is cleared in > syscall_exiting_finish, not in syscall_exiting_trace. Please ensure > that other related c

[PATCH v4 1/1] syscall.c: split trace_syscall() into 6 functions

2017-06-05 Thread Victor Krapivensky
This change removes the trace_syscall function. Now, the code that uses syscall.c trace functions is expected to check whether it is a syscall entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make an appropriate sequence of function calls. * defs.h: Change comment on TCB_INSYSCALL,

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

2017-06-05 Thread Victor Krapivensky
Hello, strace community! Accomplishments: this week I've submitted a number of patches that enable implementing a pull-style API for LuaJIT. I've had two exams this week, and this has affected my work on this project. Next week, I hope to implement initial support for LuaJIT hooking, with next_sc

[PATCH v4 1/1] syscall.c: split trace_syscall() into 6 functions

2017-06-06 Thread Victor Krapivensky
This change removes the trace_syscall function. Now, the code that uses syscall.c trace functions is expected to check whether it is a syscall entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make an appropriate sequence of function calls. * defs.h: Change comment on TCB_INSYSCALL,

[PATCH RFC v1 0/1] Initial support for Lua scripting

2017-06-10 Thread Victor Krapivensky
The script is expected to call strace.next_sc() in a infinite loop, e.g.: while true do strace.next_sc() end next_sc() returns a LuaJIT wrapper for struct tcb *, so one can access fields exposed to LuaJIT. Victor Krapivensky (1): Initial support for Lua scripting Makefile.am | 6

[PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-10 Thread Victor Krapivensky
* Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_reuse.h. * configure.ac: Add new --with-luajit configure option. * defs.h: Move code that needs to be fed to LuaJIT's FFI to... * defs_reuse.h: ...new file. * strace.c: Initial support for Lua scripting. (init): New -l op

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

2017-06-12 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've implemented initial support for LuaJIT hooking. It can be found at [1], and is probably not ready to be merged yet. It can do things like strace.hook('open', 'entering',

Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-16 Thread Victor Krapivensky
On Thu, Jun 15, 2017 at 05:28:53PM +0200, Eugene Syromiatnikov wrote: > Do you really consider multiple -l arguments in a command line an error > incompatible with continuation of strace execution? Well, yes. We don't support multiple scripts, and specifying multiple -l arguments is a usage error.

Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-16 Thread Victor Krapivensky
On Thu, Jun 15, 2017 at 05:39:25PM +, Eugene Syromyatnikov wrote: > On Thu, Jun 15, 2017 at 3:28 PM, Eugene Syromiatnikov wrote: > > Overall looks good. > > Well, except that mpers_defs.h also has STRINGIFY() macro and > undef'ing it in defs_reuse.h leads to breaking of mpers header > generat

[PATCH RFC v2 1/1] Initial support for Lua scripting

2017-06-16 Thread Victor Krapivensky
This change also defines currpers field of struct tcb if LuaJIT is enabled, even if SUPPORTED_PERSONALITIES == 1. * Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_tcb.h, syscall_class.h. * configure.ac: Add new --with-luajit configure option. * defs.h (QUAL_HOOK_ENTRY,

Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-18 Thread Victor Krapivensky
On Fri, Jun 16, 2017 at 02:46:22PM +, Eugene Syromyatnikov wrote: > Well, I don't consider having a commonly used stringification macro a > namespace pollution. But that's exactly what's happened -- I chose a name without prefix, #undef'd it at the end of the header, and relied on that it woul

Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-18 Thread Victor Krapivensky
On Mon, Jun 19, 2017 at 12:36:41AM +0300, Dmitry V. Levin wrote: > Do we need so many different stringify macros? > Could we harmonize them somehow? Well, we can't just place them into defs.h because sysent.h, but not defs.h, is included by some tests/ files. We could move all the STRINGIFY/#ifde

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

2017-06-19 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week I've implemented the next prototype of LuaJIT scripting support and the helper library, and have been thinking over further details. My work has been affected by the exams. Next

Re: [PATCH RFC v2 1/1] Initial support for Lua scripting

2017-06-19 Thread Victor Krapivensky
On Tue, Jun 20, 2017 at 04:25:23AM +0300, Dmitry V. Levin wrote: > I think you can use "void *priv;" here. C standard doesn't guarantee sizeof(function pointer) == sizeof(void *). -- Check out the vibrant tech community o

Re: [PATCH RFC v2 1/1] Initial support for Lua scripting

2017-06-21 Thread Victor Krapivensky
On Tue, Jun 20, 2017 at 10:40:58AM +0300, Dmitry V. Levin wrote: > > C standard doesn't guarantee sizeof(function pointer) == sizeof(void *). > > The alignment of pointers is usually different from the alignment of chars. OK, changed it to a void *. --

Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-21 Thread Victor Krapivensky
On Tue, Jun 20, 2017 at 04:23:11AM +0300, Dmitry V. Levin wrote: > I don't mind some preprocessor magic as well as a prefix, but FFI_ prefix > looks quite specific Could you please elaborate? What do you mean by "specific"? > while different parts of strace could benefit from > uniformly named ST

[PATCH v3 0/1] Initial support for LuaJIT scripting

2017-06-23 Thread Victor Krapivensky
Signal/error (both by number and by name)/return value injection, altering tracing options and hooking by syscall class are supported now. The helper library now provides a number of useful functions. Victor Krapivensky (1): Initial support for LuaJIT scripting Makefile.am | 9

[PATCH v3 1/1] Initial support for LuaJIT scripting

2017-06-23 Thread Victor Krapivensky
* Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_shared.h, ffi.h, syscall_class.h. * configure.ac: Add new --with-luajit configure option. * defs.h (TCB_AD_HOC_INJECT): new TCB flag. (QUAL_HOOK_ENTRY, QUAL_HOOK_EXIT): new qual flags. (struct tcb): If built with LuaJIT s

[PATCH v4 0/1] Initial support for LuaJIT scripting

2017-06-23 Thread Victor Krapivensky
Fixed a memory leak (tcp's ad_hoc_inject_opts not being freed in droptcb()). Victor Krapivensky (1): Initial support for LuaJIT scripting Makefile.am | 9 ++ configure.ac| 36 defs.h | 52 +++ defs_shared.h | 58 ffi.h

[PATCH v4 1/1] Initial support for LuaJIT scripting

2017-06-23 Thread Victor Krapivensky
* Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_shared.h, ffi.h, syscall_class.h. * configure.ac: Add new --with-luajit configure option. * defs.h (TCB_AD_HOC_INJECT): new TCB flag. (QUAL_HOOK_ENTRY, QUAL_HOOK_EXIT): new qual flags. (struct tcb): If built with LuaJIT s

Re: [PATCH v4 1/1] Initial support for LuaJIT scripting

2017-06-26 Thread Victor Krapivensky
> The patch renames one stringify macro and introduces two more temporary > stringify macros. If this doesn't signal that we need a strace-wide > stringify macro, then I don't know what does. OK. Should I put it into defs.h, or create a new file for that? ---

[PATCH v5 1/1] Initial support for LuaJIT scripting

2017-06-27 Thread Victor Krapivensky
* Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_shared.h, ffi.h. * configure.ac: Add new --with-luajit configure option. * defs.h (TCB_AD_HOC_INJECT): new TCB flag. (QUAL_HOOK_ENTRY, QUAL_HOOK_EXIT): new qual flags. (struct tcb): If built with LuaJIT support, include c

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

2017-06-27 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week I've implemented signal/error/return value injection and altering trace options from within Lua scripts, and a number of useful function in the helper Lua library. I've also wire

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

2017-07-03 Thread Victor Krapivensky
On Thu, Jun 29, 2017 at 02:46:11PM +0700, Nikolay Marchuk wrote: > This change introduces new filtering architecture primitives: filter, > filter_action and bool_expression. It also changes processing of -e > strace option. Now, filtering is done after decoding of syscall and > tcp->qual_flg stores

Re: [PATCH v3 5/6] Optimize default filtering

2017-07-03 Thread Victor Krapivensky
On Mon, Jul 03, 2017 at 03:03:15PM +0300, Eugene Syromiatnikov wrote: > On Thu, Jun 29, 2017 at 02:46:14PM +0700, Nikolay Marchuk wrote: > > * filter_action.c (default_flags, clear_default_flags): Add default flags. > > (add_action): Use action type as argument. Clear default flags. > > (filter_sys

[PATCH v5 1/1] Initial support for LuaJIT scripting

2017-07-04 Thread Victor Krapivensky
* Makefile.am: Build with LuaJIT if configured so. (strace_SOURCES): Add defs_shared.h, ffi.h. * configure.ac: Add new --with-luajit configure option. * defs.h (TCB_AD_HOC_INJECT): new TCB flag. (QUAL_HOOK_ENTRY, QUAL_HOOK_EXIT): new qual flags. (struct tcb): If built with LuaJIT support, include c

[PATCH v5 0/1] Initial support for LuaJIT scripting

2017-07-04 Thread Victor Krapivensky
Now with a section in the man page and theoretical support for non-LuaJIT Lua interpreters (no support for this in the helper library yet). Victor Krapivensky (1): Initial support for LuaJIT scripting Makefile.am | 8 ++ configure.ac | 36 +++ defs.h| 53

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

2017-07-04 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week I've written the LUAJIT SCRIPTING section for the strace man page, cleaned up some things (got rid of struct strace_luajit_funcs), and written strace.read_obj, strace.read_str, a

Re: [PATCH v5 1/1] Initial support for LuaJIT scripting

2017-07-05 Thread Victor Krapivensky
On Tue, Jul 04, 2017 at 11:31:49PM +0300, Dmitry V. Levin wrote: > This longish C string is actually a lua script, and it doesn't look nice > in this form. Wouldn't it be better if this script was translated into > a C string automatically by some Makefile rule? Yes, it would. In fact, this is wha

Re: [PATCH v5 1/1] Initial support for LuaJIT scripting

2017-07-06 Thread Victor Krapivensky
On Wed, Jul 05, 2017 at 06:17:59PM +0300, Dmitry V. Levin wrote: > On Wed, Jul 05, 2017 at 05:28:53PM +0300, Victor Krapivensky wrote: > > On Tue, Jul 04, 2017 at 11:31:49PM +0300, Dmitry V. Levin wrote: > > > This longish C string is actually a lua script, and it doesn't

[PATCH v6 0/1] Initial support for LuaJIT scripting

2017-07-06 Thread Victor Krapivensky
luajit_lib.h is now auto-generated from luajit_lib.lua. I also got rid of all the "private" underscore-prefixed members of the strace module -- we don't actually need them. See the top comment in luajit_lib.lua. Also minor fixes in the helper library and the man page section. Vic

[PATCH v6 1/1] Initial support for LuaJIT scripting

2017-07-06 Thread Victor Krapivensky
* 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, QUAL_HOOK_EXIT): new qual flags. (s

[PATCH v7 0/1] Initial support for LuaJIT scripting

2017-07-06 Thread Victor Krapivensky
The build of v6 was broken, sorry. Victor Krapivensky (1): Initial support for LuaJIT scripting Makefile.am| 17 +++ configure.ac | 36 +++ defs.h | 53 +++--- defs_shared.h | 65 ffi.h | 19 luajit.h | 328

[PATCH v7 1/1] Initial support for LuaJIT scripting

2017-07-06 Thread Victor Krapivensky
* 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, QUAL_HOOK_EXIT): new qual flags. (s

[PATCH v1 1/1] pathtrace.c: introduce pathtrace_match_set instead of pathtrace_match

2017-07-07 Thread Victor Krapivensky
pathtrace_match_set will be exposed to LuaJIT scripts. * defs.h (npaths_selected): Add a declaration. (tracing_paths): Change macro body to an equivalent but more obvious one (pathtrace_match): New macro. * pathtrace.c (num_selected): Rename to npaths_selected, make non-static. (pathmatch, upathma

Re: [PATCH v1 1/1] pathtrace.c: introduce pathtrace_match_set instead of pathtrace_match

2017-07-08 Thread Victor Krapivensky
On Sat, Jul 08, 2017 at 03:25:43PM +0700, Nikolay Marchuk wrote: > I don't think that it is necessary to rename static functions. These > functions don't change their behaviour a lot and are used only in > pathtrace.c. Only pathtrace_match renaming is useful for compatibility. > I have also implem

Re: [PATCH] pathtrace.c: introduce user-provided sets of paths

2017-07-08 Thread Victor Krapivensky
On Sat, Jul 08, 2017 at 03:28:56PM +0700, Nikolay Marchuk wrote: > * defs.h (struct path_set): Add a definition for a path set. > (global_path_set): Add a declaration. > (tracing_paths): Change macro body to use global path set variable. > (pathtrace_select_set, pathtrace_match_set): Change declara

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

2017-07-11 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 v8 1/2] Initial support for LuaJIT scripting

2017-07-11 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 v8 0/2] LuaJIT scripting support

2017-07-11 Thread Victor Krapivensky
} functions now support a table argument instead of a single string/number. Victor Krapivensky (2): Initial support for LuaJIT scripting Introduce upoken function and expose it to LuaJIT scripts .gitignore | 1 + Makefile.am| 17 +++ configure.ac | 36 ++ defs.h | 56

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

2017-07-11 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week I've introduced path-matching and memory tampering functionality for LuaJIT scripts. I've also improved some things in the helper library. Next week, I will work on testing my c

Re: [PATCH v8 1/2] Initial support for LuaJIT scripting

2017-07-14 Thread Victor Krapivensky
On Thu, Jul 13, 2017 at 09:24:03PM +0200, Eugene Syromiatnikov wrote: > On Tue, Jul 11, 2017 at 02:48:48PM +0300, Victor Krapivensky wrote: > > * .gitignore: Add luajit_lib.h. > > * Makefile.am: Build with LuaJIT if configured so. > > (strace_SOURCES): Add defs_shared.h, ffi

Re: [PATCH v8 1/2] Initial support for LuaJIT scripting

2017-07-15 Thread Victor Krapivensky
On Sat, Jul 15, 2017 at 02:42:42AM +0300, Dmitry V. Levin wrote: > On Sat, Jul 15, 2017 at 01:56:43AM +0300, Victor Krapivensky wrote: > > On Thu, Jul 13, 2017 at 09:24:03PM +0200, Eugene Syromiatnikov wrote: > > > On Tue, Jul 11, 2017 at 02:48:48PM +0300, Victor

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

2017-07-18 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've been thinking over the testing architecture for Lua scripting, and started writing some tests. Unfortunately, they are not ready for reviewing as for now. I'll post a patch

[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 v9 0/3] Add LuaJIT scripting support

2017-07-26 Thread Victor Krapivensky
On Wed, Jul 26, 2017 at 12:28:51PM +, Eugene Syromyatnikov wrote: > On Tue, Jul 25, 2017 at 12:59 PM, Victor Krapivensky > wrote: > > Victor Krapivensky (3): > > Initial support for LuaJIT scripting > > Introduce upoken function and expose it to LuaJIT scripts &

[PATCH v10 0/3] Support for LuaJIT scripting

2017-08-02 Thread Victor Krapivensky
ed to make them more consistent with another Lua functions and the C API. Now, Lua functions only raise errors when inappropriate arguments are passed. * Adjusted man page. * Fixed tests. * Other minor fixes. Victor Krapivensky (3): Initial support for LuaJIT scripting Introduce upoken function and

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

2017-08-02 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 v10 2/3] Introduce upoken function and expose it to LuaJIT scripts

2017-08-02 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.C.upoke. * luajit_lib.lua

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

2017-08-02 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 - #9 of 13

2017-08-02 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've changed a number of things in the Lua API, exposed personality names/word sizes/kernel long sizes to Lua scripts, and fixed the tests. I keep in mind all the issues pointe

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

2017-08-08 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've addressed most of the problems pointed out by Eugene. I'll send patches once they are fully ready. I understand my pace has become quite slow. I also apologize for the lac

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

2017-08-14 Thread Victor Krapivensky
On Mon, Jul 31, 2017 at 03:18:21AM +0200, Eugene Syromiatnikov wrote: > The problem here is that these function implement the same non-trivial > logic as their C counterpart, thus, any change in the logic should be > made in two places, which is indeed error-prone. I'd still disagree. The logic is

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

2017-08-14 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. * basic_filters.c (make_number_set_universal, is_number_set_universal): New functions. (syscall_classes): Make global and

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

2017-08-14 Thread Victor Krapivensky
* 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 (pro

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

2017-08-14 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

[PATCH v11 0/3] Add support for Lua scripting

2017-08-14 Thread Victor Krapivensky
sting; mentioned it in the man page). * Added support for two standalone FFI library implementations. * Fixed style issues. Next week, I'm going to: write up a NEWS entry; add more examples to the man page; work on merging my code. 1. https://github.com/m-schmoock/lcpp Victor Krapivensky (3):

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

2017-08-16 Thread Victor Krapivensky
Hello, strace community! Project: advanced syscall tampering and filtering with Lua/LuaJIT. Accomplishments: this week, I've addressed the problems in my code pointed out by Eugene. Next week, I'm going to write up a NEWS entry; add more examples to the man page; and work on merging my code. --

Re: [PATCH v11 1/3] Initial support for LuaJIT scripting

2017-08-25 Thread Victor Krapivensky
On Wed, Aug 23, 2017 at 09:47:22PM +0200, Eugene Syromiatnikov wrote: > > * strace.c (alloctcb): update the condition of presence of currpers > > field. > Btw, looks like there are other places that touch that field, wouldn't > it better to provide setter/getter for this field which would resolve t

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

2017-08-28 Thread Victor Krapivensky
* 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 (pro

[PATCH v12 0/3] Add support for Lua scripting

2017-08-28 Thread Victor Krapivensky
by Eugene. * Added an information on ffiex library and an example to the man page. 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

  1   2   >