• Dmitry Safonov's avatar
    x86/kdat: Check PTRACE_TRACEME return value · ce437d3d
    Dmitry Safonov authored
    Coverity has informed:
    
    *** CID 188251:  Error handling issues  (CHECKED_RETURN)
    /criu/arch/x86/crtools.c: 196 in kdat_x86_has_ptrace_fpu_xsave_bug_child()
    190             return 0;
    191     }
    192     #endif
    193
    194     static int kdat_x86_has_ptrace_fpu_xsave_bug_child(void *arg)
    195     {
    >>>     CID 188251:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "ptrace" without checking return value (as is done elsewhere 46 out of 51 times).
    196             ptrace(PTRACE_TRACEME, 0, 0, 0);
    197             kill(getpid(), SIGSTOP);
    198             pr_err("Continue after SIGSTOP.. Urr what?\n");
    199             _exit(1);
    200     }
    201
    
    Also added checks for kill() and waitpid().
    Signed-off-by: 's avatarDmitry Safonov <dima@arista.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    ce437d3d
Name
Last commit
Last update
..
include/asm Loading commit data...
Makefile Loading commit data...
call32.S Loading commit data...
cpu.c Loading commit data...
crtools.c Loading commit data...
kerndat.c Loading commit data...
restorer.c Loading commit data...
restorer_unmap.S Loading commit data...
sigaction_compat.c Loading commit data...
sigaction_compat_pie.c Loading commit data...
sigframe.c Loading commit data...
sys-exec-tbl.c Loading commit data...
vdso-pie.c Loading commit data...