Florian Fainelli
unread,Jul 24, 2026, 5:41:23 PM (2 days ago) Jul 24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sta...@vger.kernel.org, Benjamin Berg, Johannes Berg, Florian Fainelli, Richard Weinberger, Anton Ivanov, Johannes Berg, Brendan Higgins, David Gow, Rae Moar, Kees Cook, Jens Axboe, Al Viro, Tiwei Bie, open list:USER-MODE LINUX (UML), open list, open list:KERNEL UNIT TESTING FRAMEWORK (KUnit), open list:KERNEL UNIT TESTING FRAMEWORK (KUnit), bcm-kernel-f...@broadcom.com
From: Benjamin Berg <
benjam...@intel.com>
commit fdb2ecd35d327a1fc6bba69b97f85b494e1f4b6b upstream
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 <
benjam...@intel.com>
Link:
https://patch.msgid.link/20240919124511.2...@sipsolutions.net
Signed-off-by: Johannes Berg <
johann...@intel.com>
Signed-off-by: Florian Fainelli <
florian....@broadcom.com>
---
arch/um/drivers/chan_user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
index a66e556012c4..1434114b2f34 100644
--- a/arch/um/drivers/chan_user.c
+++ b/arch/um/drivers/chan_user.c
@@ -10,6 +10,7 @@
#include <signal.h>
#include <termios.h>
#include <sys/ioctl.h>
+#include <sys/prctl.h>
#include "chan_user.h"
#include <os.h>
#include <um_malloc.h>
@@ -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));
--
2.34.1