[PATCH 03/26] bjm: Use getarg_ull for retrieving len parameter of init_module syscall

2016-10-23 Thread Eugene Syromyatnikov
Since it is of kernel_ulont_t type, in fact. * bjm.c (SYS_FUNC(init_module)): Use "%llu" conversion specifier, obtain len aargument via getarg_ull. --- bjm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bjm.c b/bjm.c index e77b73d..c8e8470 100644 --- a/bjm.c +++ b/bjm.c

[PATCH 26/26] tests: Additional name_to_handle_at/open_by_handle_at checks

2016-10-23 Thread Eugene Syromyatnikov
* tests/file_handle.c: Additional name_to_handle_at/open_by_handle_at checks. --- tests/file_handle.c | 266 +-- 1 file changed, 259 insertions(+), 7 deletions(-) diff --git a/tests/file_handle.c b/tests/file_handle.c index 42b89d8..976cd6a 100644

[PATCH 25/26] tests: Require only presence of __NR_* macros for file_handle test

2016-10-23 Thread Eugene Syromyatnikov
* tests/file_handle.c: replace fcntl.h include with asm/unistd.h. [MAX_HANDLE_SZ]: change to defined __NR_name_to_handle_at && defined __NR_open_by_handle_at, add fcntl.h include [!MAX_HANDLE_SZ]: Add definition of MAX_HANDLE_SZ and struct file_handle. (main): Change name_to_handle_at and open_by_h

[PATCH 22/26] bjm: Parse parameters of init_module as of kernel_ulong_t type

2016-10-23 Thread Eugene Syromyatnikov
init_module does not have compat on x32/n32, so its parameters should be parsed as kernel_ulong_t. * util.c (printaddr): Change type of addr parameter to kernel_ulong_t. (printstr_ex): Change type of addr parameter to kernel_ulong_t, change type of len parameter to kernel_long_t. * defs.h: Include

[PATCH 24/26] tests: Proper type conversion in keyctl test

2016-10-23 Thread Eugene Syromyatnikov
* tests/keyctl.c (printarg): Add intermediate conversion of arg to uintptr_t since kernel_ulong_t may be of different size. --- tests/keyctl.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/keyctl.c b/tests/keyctl.c index a60dcfc..4b1e383 100644 --- a/tests/keyctl.c

[PATCH 23/26] file_handle: Use separate xlat for name_ta_handle_at flags

2016-10-23 Thread Eugene Syromyatnikov
Since the only two flags supported are AT_SYMLINK_FOLLOW and AT_EMPTY_PATH. * xlat/name_to_handle_at_flags.in: New file. * file_handle.c (SYS_FUNC(name_to_handle_at)): Use name_to_handle_at_flags for printing flags parameter. --- file_handle.c |7 +-- xlat/name_to_handle

[PATCH 20/26] kexec: Use widen_to_ulong since kexec_load has compat on x32/n32

2016-10-23 Thread Eugene Syromyatnikov
Curiously, kexec_load uses compat on x32/n32, so its parameters should be 4 bytes in size on these ABIs. * kexec.c (SYS_FUNC(kexec_load)): Use widen_to_ulong for casting parameters to proper size on x32/n32. --- kexec.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH 21/26] tests: Add kexec checks

2016-10-23 Thread Eugene Syromyatnikov
* tests/.gitignore: Add kexec_file_load, kexec_load. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add kexec_file_load.test, kexec_load.test. * tests/kexec_file_load.c: New file. * tests/kexec_file_load.test: Likewise. * tests/kexec_load.c: Likewise. * tests/kexec_load.test: Like

[PATCH 19/26] defs: Add widen_to_ulong macro

2016-10-23 Thread Eugene Syromyatnikov
This is similar to widen_to_long, but for unsigned values. * defs.h (widen_to_ulong): New macro. --- defs.h |8 1 file changed, 8 insertions(+) diff --git a/defs.h b/defs.h index 6566488..8f34679 100644 --- a/defs.h +++ b/defs.h @@ -760,6 +760,14 @@ extern unsigned current_wordsize;

[PATCH 16/26] tests: Add unshare syscall decoding check

2016-10-23 Thread Eugene Syromyatnikov
* tests/unshare.c: New file. * tests/unshare.test: New test. * tests/.gitignore: Add unshare. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add unshare.test. --- tests/.gitignore |1 + tests/Makefile.am |2 ++ tests/unshare.c| 82

[PATCH 18/26] kexec: Fix zeroing of higher bits of flags parameter in kexec_load

2016-10-23 Thread Eugene Syromyatnikov
* kexec.c (SYS_FUNC(kexec_load)): Perform type conversion before negation in order to properly negate higher bits of KEXEC_ARCH_MASK. --- kexec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec.c b/kexec.c index 9ced015..d27bfe1 100644 --- a/kexec.c +++ b/kexec.c @@ -9

[PATCH 13/26] tests: Add old*stat checks

2016-10-23 Thread Eugene Syromyatnikov
* tests/.gitignore: Add oldfstat, oldlstat, oldstat. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add oldfstat.test, oldlstat.test, oldstat.test. * tests/oldfstat.c: New file. * tests/oldfstat.test: Likewise. * tests/oldlstat.c: Likewise. * tests/oldlstat.test: Likewise. * tests

[PATCH 17/26] kexec: Add printing of struct kexec_segment field names

2016-10-23 Thread Eugene Syromyatnikov
* kexec.c (print_seg): print field names of the kexec_segment structure. --- kexec.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kexec.c b/kexec.c index 128b1df..9ced015 100644 --- a/kexec.c +++ b/kexec.c @@ -53,11 +53,11 @@ print_seg(struct tcb *tcp, void *elem_bu

[PATCH 12/26] tests: Additional tests for stat decoder

2016-10-23 Thread Eugene Syromyatnikov
PRINT_SYSCALL_HEADER/PRINT_SYSCALL_FOOTER now contain open/close brace pair in order to save errno. PRINT_SYSCALL_FOOTER now uses sprintrc for printing rc/errno. * xstatx.c (main): Add check for non-available pointer, for block device file. Update PRINT_SYSCALL_FOOTER call convention. * fstatat.c

[PATCH 15/26] clone: Use kernel_ulong_t as type of flags parameter of unshare call

2016-10-23 Thread Eugene Syromyatnikov
Kernel declares flags parameter as long and looks like x32 and n32 implement no compat for this call. * clone.c (SYS_FUNC(unshare)): Use getarg_ull and printflags64 for obtaining and parsing flags parameter. --- clone.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clone.

[PATCH 02/26] xlat: Add values for MODULE_INIT_* constants

2016-10-23 Thread Eugene Syromyatnikov
* bjm.c (MODULE_INIT_IGNORE_MODVERSIONS, MODULE_INIT_IGNORE_VERMAGIC): Remove. * xlat/module_init_flags.in: Add values for MODULE_INIT_IGNORE_MODVERSIONS and MODULE_INIT_IGNORE_VERMAGIC records. --- bjm.c |3 --- xlat/module_init_flags.in |4 ++-- 2 files changed, 2 ins

[PATCH 06/26] tests: Some additional checks for fanotify_mark

2016-10-23 Thread Eugene Syromyatnikov
* tests/fanotify_mark.c (do_call): New function. (main): Use it. --- tests/fanotify_mark.c| 137 +- tests/fanotify_mark.test |2 +- 2 files changed, 135 insertions(+), 4 deletions(-) diff --git a/tests/fanotify_mark.c b/tests/fanotify_mark.c in

[PATCH 10/26] clone: Use separate xlat for nstype parameter of setns syscall

2016-10-23 Thread Eugene Syromyatnikov
nstype is not flag set but specific type value against which it is compared in kernel (see kernel/nsproxy.c, SYSCALL_DEFINE2(setns, ...)). * xlat/setns_types.in: New file. * clone.c: Use printxval and setns_types for nstype parameter. --- clone.c |3 ++- xlat/setns_types.in |8

[PATCH 14/26] clone: Use separate flag list for unshare

2016-10-23 Thread Eugene Syromyatnikov
Not all clone flags could be passed to unshare (see check_unshare_flags function in kernel/fork.c). * xlat/unshare_flags.in: New file. * clone.c (SYS_FUNC(unshare)): Use unshare_flags for printing flags parameter. --- clone.c |3 ++- xlat/unshare_flags.in | 13 + 2

[PATCH 04/26] tests: Add checks for {init,finit,delete}_module syscall decoders

2016-10-23 Thread Eugene Syromyatnikov
* tests/.gitignore: Add delete_nodule, finit_module, init_module. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add delete_module.test, finit_module.test, init_module.test. (EXTRA_DIST): Add init_delete_module.h. * tests/delete_module.c: New file. * tests/delete_module.test: Like

[PATCH 11/26] tests: Add setns syscall decoding check

2016-10-23 Thread Eugene Syromyatnikov
* tests/setns.c: New file. * tests/setns.test: New test. * tests/.gitignore: Add setns. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add setns.test. --- tests/.gitignore |1 + tests/Makefile.am |2 ++ tests/setns.c | 75 +++

[PATCH 08/26] tests: Additional capset decoder checks

2016-10-23 Thread Eugene Syromyatnikov
* caps.awk: Add patterns for additional checks. * caps.c: Implement additional checks. --- tests/caps.awk | 16 +--- tests/caps.c | 28 +++- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/tests/caps.awk b/tests/caps.awk index 67003ac..6130

[PATCH 09/26] tests: Check non-verbose capget/capset output

2016-10-23 Thread Eugene Syromyatnikov
* tests/caps-abbrev.awk: New file. * tests/caps-abbrev.c: Likewise. * tests/caps-abbrev.test: New test. * tests/.gitignore: Add caps-abbrev. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add caps-abbrev.test. (EXTRA_DIST): Add caps-abbrev.awk. --- tests/.gitignore |1 +

[PATCH 07/26] tests: Add fanotify_init syscall decoding check

2016-10-23 Thread Eugene Syromyatnikov
* tests/fanotify_init.c: New file. * tests/fanotify_init.test: New test. * tests/.gitignore: Add fanotify_init. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add fanotify_init.test. --- tests/.gitignore |1 + tests/Makefile.am|2 ++ tests/fanotify_init.c

[PATCH 05/26] tests: use sprintrc in tests/fanotify_mark.c

2016-10-23 Thread Eugene Syromyatnikov
* tests/fanotify.c (main): Use sprintrc. --- tests/fanotify_mark.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fanotify_mark.c b/tests/fanotify_mark.c index 9cac5ef..a994c15 100644 --- a/tests/fanotify_mark.c +++ b/tests/fanotify_mark.c @@ -11,7 +11,7 @@ main(void)

[PATCH 01/26] Remove parser of create_module syscall

2016-10-23 Thread Eugene Syromyatnikov
Since create_module syscall is present only in kernels before Linux 2.6 and strace does not support those kernels, there is no use to keep this parser any longer. * bjm.c (SYS_FUNC(create_module)): Remove. * linux/dummy.h (sys_create_module): Add stub alias. --- bjm.c |8 lin

[PATCH 00/26] Various misc tests and additional checks

2016-10-23 Thread Eugene Syromyatnikov
Hello. This patchset adds some minor decoder tests, amend existing decoder tests with additional checks and provides some minor fixes. * New tests: init_module, finit_module, delete_module, fanotify_init, setns, unshare, oldfstat, oldlstat, oldstat, kexec_load, kexec_file_load. * Additiona