• Eric W. Biederman's avatar
    signal: Replace force_fatal_sig with force_exit_sig when in doubt · fcb116bc
    Eric W. Biederman authored
    Recently to prevent issues with SECCOMP_RET_KILL and similar signals
    being changed before they are delivered SA_IMMUTABLE was added.
    
    Unfortunately this broke debuggers[1][2] which reasonably expect
    to be able to trap synchronous SIGTRAP and SIGSEGV even when
    the target process is not configured to handle those signals.
    
    Add force_exit_sig and use it instead of force_fatal_sig where
    historically the code has directly called do_exit.  This has the
    implementation benefits of going through the signal exit path
    (including generating core dumps) without the danger of allowing
    userspace to ignore or change these signals.
    
    This avoids userspace regressions as older kernels exited with do_exit
    which debuggers also can not intercept.
    
    In the future is should be possible to improve the quality of
    implementation of the kernel by changing some of these force_exit_sig
    calls to force_fatal_sig.  That can be done where it matters on
    a case-by-case basis w...
    fcb116bc
signal_32.c 15.1 KB