From patchwork Thu Oct 24 14:28:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 2001779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=AXQ5SRYc; dkim=pass (1024-bit key; unprotected) header.d=antgroup.com header.i=@antgroup.com header.a=rsa-sha256 header.s=default header.b=Wt7ZIfQA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ7rQ0Rkcz1xx6 for ; Fri, 25 Oct 2024 01:40:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Vju3PSxIcD7VxO0E+oMlNC+TNtVp16e3ZGllvv3Wkog=; b=AXQ5SRYc5WPbzI91proyxMDzDs FufN9kVfq5MNlrSkHK08mjrZY3Q7/K5LdCMniCOHO70WEVBnQ07nciGHQiM6qNbF7CZty5FNvH7Zh zYtBB7T5KIsujoTBI0fT2NV0763tcf5YApDP1nTVpOEGE52A9APIyqYlODIw5Q0WTM8UC+kW8pUyo fM0x9pllC3V63gqiLymde18tDr6xaMOXnqH7UXMd68Xty5MB8HbEzKlKioo++KGyE1bUWojGlMZCr pIPntG4PrTbBLOun3XR8diL5kPxTAHVwMWgbHnK1S//AkgFzkBSBP4IyIT1YUCprxk0c8r8m8uGTt Q9erG6/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3z19-00000000mJD-21dP; Thu, 24 Oct 2024 14:40:51 +0000 Received: from out0-221.mail.aliyun.com ([140.205.0.221]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ypO-00000000jVu-3dFm for linux-um@lists.infradead.org; Thu, 24 Oct 2024 14:28:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1729780119; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Vju3PSxIcD7VxO0E+oMlNC+TNtVp16e3ZGllvv3Wkog=; b=Wt7ZIfQALSH0PXsZ292yjGcHGBRMaiqiDGwseh2cbH18q2f1nB62TxjiSrmMATDaYxNxTQInJba++DKOeoff78wVyjMgb7/OUFk/uIF5H8f3nHLM2N0yDoFLZCN4neP9N2sADlUNJoyw+cQi9xzsNIqNQ3sJFwzQIY9+wd4/HEc= Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.ZreBszp_1729780114 cluster:ay29) by smtp.aliyun-inc.com; Thu, 24 Oct 2024 22:28:36 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 1/4] um: Add os_set_pdeathsig helper function Date: Thu, 24 Oct 2024 22:28:25 +0800 Message-Id: <20241024142828.2612828-2-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024142828.2612828-1-tiwei.btw@antgroup.com> References: <20241024142828.2612828-1-tiwei.btw@antgroup.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_072843_406213_26BC5D60 X-CRM114-Status: UNSURE ( 7.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This helper can be used to set the parent-death signal of the calling process to SIGKILL to ensure that the process will be killed if the UML kernel dies unexpectedly without proper cleanup. This help [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [140.205.0.221 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.221 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.221 listed in sa-accredit.habeas.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.221 listed in bl.score.senderscore.com] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This helper can be used to set the parent-death signal of the calling process to SIGKILL to ensure that the process will be killed if the UML kernel dies unexpectedly without proper cleanup. This helper will be used in the follow-up patches. Signed-off-by: Tiwei Bie --- arch/um/include/shared/os.h | 2 ++ arch/um/os-Linux/process.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 09f8201de5db..d709a24dc6fc 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -216,6 +216,8 @@ extern int os_drop_memory(void *addr, int length); extern int can_drop_memory(void); extern int os_mincore(void *addr, unsigned long len); +void os_set_pdeathsig(void); + /* execvp.c */ extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); /* helper.c */ diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index f20602e793d9..9f086f939420 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -203,3 +204,8 @@ void init_new_thread_signals(void) set_handler(SIGIO); signal(SIGWINCH, SIG_IGN); } + +void os_set_pdeathsig(void) +{ + prctl(PR_SET_PDEATHSIG, SIGKILL); +} From patchwork Thu Oct 24 14:28:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 2001778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=swDSi8uR; dkim=pass (1024-bit key; unprotected) header.d=antgroup.com header.i=@antgroup.com header.a=rsa-sha256 header.s=default header.b=xFifBZFG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ7rQ0s2mz1xxC for ; Fri, 25 Oct 2024 01:40:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DW2X6x5nYJj0dxAEofhIKyQStzlJYeyPAOconukYPcI=; b=swDSi8uRdWZj5YSARDr+sszuN2 o6AfxuML6w9mzG8TDnpS9uU6bwSuqvICoBLxPFCsS+/ruktYF7bPrVh8fWwsOB7XGKCvOLlFkezRj crEFvh4OMa5avvYf/cBjWAaZP3a/xFdu8/1pqxCkpcUMs15MFCI4FbCcWWj5CdlBfNUq26nseLfjH om4C8Wip5aXyzjht+Ox13lqwifrb+r71AN5VLbYQrT4yJDm0KxLT10Sp85+/+dJ33vuA1j9f9/b+t UEt5OpuEVtFKsh+jP2sjzAU0J5KnupvNQjXpfY4FczZUpS3Fy3UO8vnd6Zn0nEI6C7MtXX7IKKxbd Gi9L0cdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3z19-00000000mJl-3TG4; Thu, 24 Oct 2024 14:40:51 +0000 Received: from out0-198.mail.aliyun.com ([140.205.0.198]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ypO-00000000jVQ-3c3X for linux-um@lists.infradead.org; Thu, 24 Oct 2024 14:28:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1729780117; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=DW2X6x5nYJj0dxAEofhIKyQStzlJYeyPAOconukYPcI=; b=xFifBZFGfevXW1X/9XqfwjvzJirpgISM/W0cLGJUbiPKp88cLb8H1JbXbPqUORtEq4U6ZtU/XjKM7YLP2fYoJRXizHJXVmSPXfbZV2v64qo8wbwHmLMGeOH1MZOQKUjTwVnPybXJvHVDxoKwR0Ug3jV2p1cIY+wVsuMHJcffXXE= Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.ZreBt-9_1729780116 cluster:ay29) by smtp.aliyun-inc.com; Thu, 24 Oct 2024 22:28:36 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 2/4] um: Set parent-death signal for ubd io thread/process Date: Thu, 24 Oct 2024 22:28:26 +0800 Message-Id: <20241024142828.2612828-3-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024142828.2612828-1-tiwei.btw@antgroup.com> References: <20241024142828.2612828-1-tiwei.btw@antgroup.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_072843_387614_04BBB754 X-CRM114-Status: UNSURE ( 6.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The ubd io thread is not really a traditional thread. Set the parent-death signal for it to ensure that it will be killed if the UML kernel dies unexpectedly without proper cleanup. Signed-off-by: Tiwei Bie --- arch/um/drivers/ubd_kern.c | 1 + 1 file changed, 1 insertion(+) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [140.205.0.198 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.198 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.198 listed in sa-accredit.habeas.com] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.198 listed in bl.score.senderscore.com] X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The ubd io thread is not really a traditional thread. Set the parent-death signal for it to ensure that it will be killed if the UML kernel dies unexpectedly without proper cleanup. Signed-off-by: Tiwei Bie --- arch/um/drivers/ubd_kern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 7f28ec1929dc..2b8d04e67600 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -1499,6 +1499,7 @@ int io_thread(void *arg) { int n, count, written, res; + os_set_pdeathsig(); os_fix_helper_signals(); while(1){ From patchwork Thu Oct 24 14:28:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 2001781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=p9BV/2mv; dkim=pass (1024-bit key; unprotected) header.d=antgroup.com header.i=@antgroup.com header.a=rsa-sha256 header.s=default header.b=o4Vnko3A; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ7rR0CZPz1xxF for ; Fri, 25 Oct 2024 01:40:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o7nomrNF4UUPmRyX4jzl23OQWMT1pV1gEWGtKNbTeqs=; b=p9BV/2mvWt3ZSPR4cnXT41+Aiu 9pP1S5bFKvaH2xTUU+DsNh4D17K5cfQzezwi+0xjo4ST7yo496/6RSPAtwdPm9gnV7YzU0BsYL/J+ VbjjtkMv8xv7Q+pYfpzPqWPl271qgV6mJFlr0uLaPaslSs5VUR7fTQOYk2MyNWWb0Yx0+5hMJLkQd nB4S0IRRppA4FuBfqygssyxOfG6bySshe547gcw5FvdhgbCEBhpDdpTzDqfFFxK1/dnKGbHShpTGc XN9PyHlBZq2UYy2k2qAQFn/6pxrlYiAR2liaI2FLCX5MUyjG1rT8J24okJekmnh0PZ8m6EuCNTyHB 3OB7sjBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3z1A-00000000mKK-3BqS; Thu, 24 Oct 2024 14:40:52 +0000 Received: from out0-195.mail.aliyun.com ([140.205.0.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ypO-00000000jVf-3iMQ for linux-um@lists.infradead.org; Thu, 24 Oct 2024 14:28:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1729780118; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=o7nomrNF4UUPmRyX4jzl23OQWMT1pV1gEWGtKNbTeqs=; b=o4Vnko3AJULnvRhVZjHaiYWcOaoEAROuMn51S1xO5XJIiAjpkff8GeXXKnkhctQHO09yAyCK0ORw0Ho8zvAeI6UOVg1O/m9lJhE8DXg3b7fD3GNB6HSPEcpqFp6BHOUOEFfyt5Cyu0UNfIGRNr/6TMN5tfSlZZqv/CGbH9nBLpI= Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.ZreBt-G_1729780117 cluster:ay29) by smtp.aliyun-inc.com; Thu, 24 Oct 2024 22:28:37 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 3/4] um: Set parent-death signal for write_sigio thread/process Date: Thu, 24 Oct 2024 22:28:27 +0800 Message-Id: <20241024142828.2612828-4-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024142828.2612828-1-tiwei.btw@antgroup.com> References: <20241024142828.2612828-1-tiwei.btw@antgroup.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_072843_411447_C6B19002 X-CRM114-Status: UNSURE ( 6.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The write_sigio thread is not really a traditional thread. Set the parent-death signal for it to ensure that it will be killed if the UML kernel dies unexpectedly without proper cleanup. Signed-off-by: Tiwei Bie --- arch/um/os-Linux/sigio.c | 1 + 1 file changed, 1 insertion(+) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.195 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.195 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.195 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The write_sigio thread is not really a traditional thread. Set the parent-death signal for it to ensure that it will be killed if the UML kernel dies unexpectedly without proper cleanup. Signed-off-by: Tiwei Bie --- arch/um/os-Linux/sigio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index 9e71794839e8..9aac8def4d63 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -55,6 +55,7 @@ static int write_sigio_thread(void *unused) int i, n, respond_fd; char c; + os_set_pdeathsig(); os_fix_helper_signals(); fds = ¤t_poll; while (1) { From patchwork Thu Oct 24 14:28:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 2001782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1C5tiYNj; dkim=pass (1024-bit key; unprotected) header.d=antgroup.com header.i=@antgroup.com header.a=rsa-sha256 header.s=default header.b=QvUxdWEa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZ7rR326Lz1xxG for ; Fri, 25 Oct 2024 01:40:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9F+/gG2/NpWN+fSAPQ0vZiXCLF44MabL2VbrE4Rm4ys=; b=1C5tiYNjRlN9n5VHlQtTLd3rbw BSshKAaMOlYgHkwCFAphCS4mma8Lt9WBVKUy8g3golVtIetLYbNXTYmO6AOGwNycfSsxAuKlBfjxh ID+BdSgqP3AJiY3hCKQb1H1viU+I2hFLGzWTdQyRaUL5Ljz4olWakGqkGP2U0+Js9ALPUxago3ffZ /1z4JBDRz6F7Myzi97tk9/RrBsBtzD2mIU+59OC7sAOU7paDZOsCN64+8es+dOK3DLThYyfPvdOLo CY2KKVXvOHr5EZ/l7P36LYssogPYt9wMN+nQJM5rp+gH8s4StjWghN0RIBU9Y0dB4qXkMPn6FUgTb 5HWtb7Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3z1B-00000000mKf-0gRh; Thu, 24 Oct 2024 14:40:53 +0000 Received: from out0-196.mail.aliyun.com ([140.205.0.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3ypO-00000000jVh-3WJD for linux-um@lists.infradead.org; Thu, 24 Oct 2024 14:28:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1729780118; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=9F+/gG2/NpWN+fSAPQ0vZiXCLF44MabL2VbrE4Rm4ys=; b=QvUxdWEaSQG+z/jptVsDJeHzvQUcjB/UYjI7cESZc+AvCXGGWhpPNt41b+kENqfJRzhNNSphLXDNuPRq0Qcr1H42/kUO/W5x+BeOXxpqz55vo7seKpbBkkKCSFL0qYeE15dIkG3NH4ydC9eXU5fXUie5p1cUZjlZvJr/3BQ6bUM= Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.ZreBt-P_1729780117 cluster:ay29) by smtp.aliyun-inc.com; Thu, 24 Oct 2024 22:28:37 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH 4/4] um: Use os_set_pdeathsig helper in winch thread/process Date: Thu, 24 Oct 2024 22:28:28 +0800 Message-Id: <20241024142828.2612828-5-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024142828.2612828-1-tiwei.btw@antgroup.com> References: <20241024142828.2612828-1-tiwei.btw@antgroup.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241024_072843_471697_3F6D8308 X-CRM114-Status: UNSURE ( 7.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Since we have a helper now, let's switch to using it. It will make the code slightly more consistent. Signed-off-by: Tiwei Bie --- arch/um/drivers/chan_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [140.205.0.196 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.196 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.196 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [140.205.0.196 listed in sa-trusted.bondedsender.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Since we have a helper now, let's switch to using it. It will make the code slightly more consistent. Signed-off-by: Tiwei Bie --- arch/um/drivers/chan_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 1434114b2f34..35f9beeb19b3 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "chan_user.h" #include #include @@ -162,7 +161,7 @@ static __noreturn int winch_thread(void *arg) int count; char c = 1; - prctl(PR_SET_PDEATHSIG, SIGKILL); + os_set_pdeathsig(); pty_fd = data->pty_fd; pipe_fd = data->pipe_fd;