• Dmitry Safonov's avatar
    cr-exec: check syscall's number right before injecting it · 5141d323
    Dmitry Safonov authored
    So, I made a mistake in find_syscall: it can't use arch_task_compatible
    to find out in which mode the application is (native/compat).
    The reason is that arch_task_compatible uses PTRACE_GETREGSET.
    And at the moment of find_syscall we haven't yet seized the task.
    
    In this patch I move syscall's number check right before injecting
    a syscall, where we have parasite_ctl with all needed information
    about task's mode.
    This makes error-path for wrong syscall number longer and subtler
    (includes curing now), but I think it's a corner-case, so as
    it makes error-less path to execute_syscall shorter and without
    additional ptrace syscalls, it's better.
    Reported-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Cc: Andrew Vagin <avagin@virtuozzo.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    5141d323
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...