• Jeff Dike's avatar
    [PATCH] uml: fix scheduler race · 33bc8cec
    Jeff Dike authored
    This fixes a use-after-free bug in the context switching.  A process going
    out of context after exiting wakes up the next process and then kills
    itself.  The problem is that when it gets around to killing itself is up to
    the host and can happen a long time later, including after the incoming
    process has freed its stack, and that memory is possibly being used for
    something else.
    
    The fix is to have the incoming process kill the exiting process just to
    make sure it can't be running at the point that its stack is freed.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    33bc8cec
process_kern.c 13.6 KB