From 250127216dd6635f5730752d7444bdec992aecb0 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Sun, 18 Aug 2013 13:30:09 +0200 Subject: [PATCH] um: Run UML in it's own session. If UML is not run by a shell it can happen that UML will kill unrelated proceses upon a fatal exit because it issues a kill(0, ...). To prevent such oddities we create a new session in main(). Reported-and-tested-by: Richard W.M. Jones Signed-off-by: Richard Weinberger --- arch/um/os-Linux/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 749c96da7b99..e1704ff600ff 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -123,6 +123,8 @@ int __init main(int argc, char **argv, char **envp) setup_env_path(); + setsid(); + new_argv = malloc((argc + 1) * sizeof(char *)); if (new_argv == NULL) { perror("Mallocing argv"); -- GitLab