• Roland McGrath's avatar
    [PATCH] fix posix-timers leak · c68f9a4d
    Roland McGrath authored
    Exec fails to clean up posix-timers.  This manifests itself in two ways, one
    worse than the other.  In the single-threaded case, it just fails to clear out
    the timers on exec.  POSIX says that exec clears out the timers from
    timer_create (though not the setitimer ones), so it's wrong that a lingering
    timer could fire after exec and kill the process with a signal it's not
    expecting.  In the multi-threaded case, it not only leaves lingering timers,
    but it leaks them entirely when it replaces signal_struct, so they will never
    be freed by the process exiting after that exec.  The new per-user
    RLIMIT_SIGPENDING actually limits the damage here, because a UID will fill up
    its quota with leaked timers and then never be able to use timer_create again
    (that's what my test program does).  But if you have many many untrusted UIDs,
    this leak could be considered a DoS risk.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c68f9a4d
exec.c 31.8 KB