Implement kexec_file_load syscall decoding

* xlat/kexec_file_load_flags.in: New file.
* kexec.c: Include "xlat/kexec_file_load_flags.h".
(SYS_FUNC(kexec_file_load)): New function.
* linux/dummy.h (sys_kexec_file_load): Remove stub alias.
* pathtrace.c (pathtrace_match): Add SEN_kexec_file_load.
This commit is contained in:
Дмитрий Левин 2015-11-22 18:51:05 +00:00
parent 7aa9c0d299
commit ea1970500e
4 changed files with 25 additions and 1 deletions

21
kexec.c
View File

@ -79,3 +79,24 @@ SYS_FUNC(kexec_load)
return RVAL_DECODED;
}
#include "xlat/kexec_file_load_flags.h"
SYS_FUNC(kexec_file_load)
{
/* kernel_fd */
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
/* initrd_fd */
printfd(tcp, tcp->u_arg[1]);
tprints(", ");
/* cmdline_len */
tprintf("%lu, ", tcp->u_arg[2]);
/* cmdline */
printstr(tcp, tcp->u_arg[3], tcp->u_arg[2]);
tprints(", ");
/* flags */
printflags(kexec_file_load_flags, tcp->u_arg[4], "KEXEC_FILE_???");
return RVAL_DECODED;
}

View File

@ -32,7 +32,6 @@
#endif
/* still unfinished */
#define sys_kexec_file_load printargs
#define sys_lookup_dcookie printargs
#define sys_name_to_handle_at printargs
#define sys_open_by_handle_at printargs

View File

@ -163,6 +163,7 @@ pathtrace_match(struct tcb *tcp)
switch (s->sen) {
case SEN_dup2:
case SEN_dup3:
case SEN_kexec_file_load:
case SEN_sendfile:
case SEN_sendfile64:
case SEN_tee:

View File

@ -0,0 +1,3 @@
KEXEC_FILE_UNLOAD 1
KEXEC_FILE_ON_CRASH 2
KEXEC_FILE_NO_INITRAMFS 4