• Al Viro's avatar
    don't dump the threads that had been already exiting when zapped. · 9bb7c382
    Al Viro authored
    commit 77f6ab8b upstream.
    
    Coredump logics needs to report not only the registers of the dumping
    thread, but (since 2.5.43) those of other threads getting killed.
    
    Doing that might require extra state saved on the stack in asm glue at
    kernel entry; signal delivery logics does that (we need to be able to
    save sigcontext there, at the very least) and so does seccomp.
    
    That covers all callers of do_coredump().  Secondary threads get hit with
    SIGKILL and caught as soon as they reach exit_mm(), which normally happens
    in signal delivery, so those are also fine most of the time.  Unfortunately,
    it is possible to end up with secondary zapped when it has already entered
    exit(2) (or, worse yet, is oopsing).  In those cases we reach exit_mm()
    when mm->core_state is already set, but the stack contents is not what
    we would have in signal delivery.
    
    At least on two architectures (alpha and m68k) it leads to infoleaks - we
    ...
    9bb7c382
exit.c 44.7 KB