From: Andi Kleen This addresses one of the review comments earlier for the user core patchkit: when the core dump handler is executed make sure there is no potential for recursion in case it crashes again. This currently does it for all pipe user mode helpers. In theory it could be done only for core dump user helpers, but there are currently no other users of this function. Signed-off-by: Andi Kleen Cc: Alan Cox Signed-off-by: Andrew Morton --- kernel/kmod.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN kernel/kmod.c~support-piping-into-commands-in-proc-sys-kernel-core_pattern-fix-2 kernel/kmod.c --- a/kernel/kmod.c~support-piping-into-commands-in-proc-sys-kernel-core_pattern-fix-2 +++ a/kernel/kmod.c @@ -35,6 +35,7 @@ #include #include #include +#include #include extern int max_threads; @@ -158,6 +159,9 @@ static int ____call_usermodehelper(void FD_SET(0, fdt->open_fds); FD_CLR(0, fdt->close_on_exec); spin_unlock(&f->file_lock); + + /* and disallow core files too */ + current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0}; } /* We can run anywhere, unlike our parent keventd(). */ _