From: Benjamin Berg Date: Thu, 19 Sep 2024 12:45:05 +0000 (+0200) Subject: um: Set parent death signal for winch thread/process X-Git-Tag: v6.13-rc1~18^2~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdb2ecd35d327a1fc6bba69b97f85b494e1f4b6b;p=thirdparty%2Fkernel%2Flinux.git um: Set parent death signal for winch thread/process The winch "thread" is really a separate process. Using prctl to set PR_SET_PDEATHSIG ensures that this separate thread will be killed if the UML kernel itself dies unexpectedly and does not perform proper cleanup. Signed-off-by: Benjamin Berg Link: https://patch.msgid.link/20240919124511.282088-5-benjamin@sipsolutions.net Signed-off-by: Johannes Berg --- diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index a66e556012c48..1434114b2f34d 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "chan_user.h" #include #include @@ -161,6 +162,8 @@ static __noreturn int winch_thread(void *arg) int count; char c = 1; + prctl(PR_SET_PDEATHSIG, SIGKILL); + pty_fd = data->pty_fd; pipe_fd = data->pipe_fd; count = write(pipe_fd, &c, sizeof(c));