Message ID | 20201217142356.27890-1-aryabinin@virtuozzo.com |
---|---|
State | New |
Series | "ptrace: fix task_join_group_stop() for the case when current is traced" |
Headers | show
Delivered-To: criupatchwork@gmail.com Received: from imap.gmail.com [108.177.119.109] by patchwork.criu.org with IMAP (fetchmail-6.4.8) for <root@localhost> (single-drop); Thu, 17 Dec 2020 15:25:16 +0100 (CET) Received: by 2002:aa6:c11a:0:b029:a4:55c9:6120 with SMTP id c26csp1250635lkp; Thu, 17 Dec 2020 06:25:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzG/vUvFgpn6QhYrM1D9x98WBSeLBjZ7W00sJ0HYj/0knFYIqZUkpC2vtSvrUkGTzs4pHDn X-Received: by 2002:a2e:164e:: with SMTP id 14mr16916466ljw.482.1608215111709; Thu, 17 Dec 2020 06:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608215111; cv=none; d=google.com; s=arc-20160816; b=M3yAL/2nIfu2wTR+ZX9tdM4YZwT/p4RVRB43ByIg6HH8L5THxam488oievud+BapIo DIhPuvtIzDRxtgughgKPxhtb1h9EGENYKsmy+2DkGr4CIyXTF8V8DnBT/VWp6i/C+o0c eY6fA6TsvzPayizbtgUVHXdBAJ3P6d42qlthDnignmZHW1/FxImHzFiO304h7seFt2ou JvG9s75uru5Iaf2kVoFX+lh7yZJyv6Mmus430UpJ1Ev1jCJK0Neh71qaLXTEhum/7Ou1 fZb9znyIkPbAT77IIMt9rCdoXQkUnvOh8CCt9NRxr4jtFq3C8YWERcRSnwmURLbb3vG9 CGQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from; bh=k3bw15gnoKuff8bmql79wrzqHcPKv3XSpY8XzdlrUzo=; b=vRy8q2ehOxi9W0qhJ+anm/1iMO5RXU6WMmDhPpSOInYzBR+CBJ4m3Q6n9hhp8ZFKsg 9K+wEAdaXFqaRLcQSl7HrLQB6NpBfa+UDQGu7YyuCVRX+WsfrzgrCYnX12aWUxNNx8cC bRwfFuitqGtF+z++8aQ/ARnXITrDAmcNauarxMpG5gJF6I3OxmtobpoX0suB/00/dXjO dkTJsrt63Akd8SX8IXwuG3wPjrMbRpo+ltKM9l9LGGpYyktKEcHbgxUYtZbB6MN/hqR6 qn4A2KRrJzmIZwPmDz1Z1rfqXuZbCegDkRz/2JFtGopBoZtzuA7X81LabbBjAAx8YwMR SRpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: <devel-bounces@openvz.org> Received: from mail.openvz.org (mail.openvz.org. [185.231.241.50]) by mx.google.com with ESMTPS id j140si1530878lfj.260.2020.12.17.06.25.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Dec 2020 06:25:11 -0800 (PST) Received-SPF: pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) client-ip=185.231.241.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from localhost.localdomain (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 0BHENvmI009238; Thu, 17 Dec 2020 17:24:00 +0300 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2175.outbound.protection.outlook.com [104.47.17.175]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 0BHENtCN009235 for <devel@openvz.org>; Thu, 17 Dec 2020 17:23:55 +0300 Received: from AM5PR0202CA0002.eurprd02.prod.outlook.com (2603:10a6:203:69::12) by DBBPR08MB5979.eurprd08.prod.outlook.com (2603:10a6:10:205::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.17; Thu, 17 Dec 2020 14:23:58 +0000 Received: from VE1EUR01FT048.eop-EUR01.prod.protection.outlook.com (2603:10a6:203:69:cafe::30) by AM5PR0202CA0002.outlook.office365.com (2603:10a6:203:69::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 17 Dec 2020 14:23:58 +0000 Authentication-Results: spf=pass (sender IP is 185.231.240.75) smtp.mailfrom=virtuozzo.com; openvz.org; dkim=none (message not signed) header.d=none; openvz.org; dmarc=pass action=none header.from=virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of virtuozzo.com designates 185.231.240.75 as permitted sender) receiver=protection.outlook.com; client-ip=185.231.240.75; helo=relay3.sw.ru; Received: from relay3.sw.ru (185.231.240.75) by VE1EUR01FT048.mail.protection.outlook.com (10.152.3.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 17 Dec 2020 14:23:57 +0000 Received: from [192.168.15.60] (helo=localhost.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from <aryabinin@virtuozzo.com>) id 1kpuBn-00DOHi-Us; Thu, 17 Dec 2020 17:23:31 +0300 From: Andrey Ryabinin <aryabinin@virtuozzo.com> To: devel@openvz.org Date: Thu, 17 Dec 2020 17:23:56 +0300 Message-Id: <20201217142356.27890-1-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef482642-e6bc-498e-3b58-08d8a2976452 X-MS-TrafficTypeDiagnostic: DBBPR08MB5979: X-Forefront-Antispam-Report: CIP:185.231.240.75; CTRY:RU; LANG:en; SCL:-1; SRV:; IPV:CAL; SFV:SKN; H:relay3.sw.ru; PTR:relay.sw.ru; CAT:NONE; SFS:; DIR:INB; X-MS-Oob-TLC-OOBClassifiers: OLM:913; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KBuR/Q/DLzepgGt1yWnp0m2EQVQ9S/1GzspzgNMnaJ7k7Jz/9jVnjYx4PsZe?= =?us-ascii?Q?CBmOZsZK9cdVWfe6GX5TpzzZoJGvCXxFWa7LYkxfoPzW3VvTIHL0Ie6BCwdt?= =?us-ascii?Q?MyCS/U8aWRH3F9shp5ISxSLA1655sTComeOhtckhkm/4+Bdtx01kFzadEb4e?= =?us-ascii?Q?/OGbg2lyGHiOg6oTWM7n0TJyHcj8XUIPfxHwg0xaB5T5mV/S2Buczw1cO89k?= =?us-ascii?Q?Ak3DVhmU+zFsXNSVYdcTL4ECKfDDHyy7AQqz96eclj1K7OLGTH9/qX1rf6AR?= =?us-ascii?Q?SeYRGbY4xR/fSapcW2qyUeTbFQLcq0lk1nMque3vovlU8PdCFWGxCZgoRK/g?= =?us-ascii?Q?8vA2XWsJKiBP8WnAsDeJi2qlUXwVzPRfdbnvQ7qO5dTeTuBSHRtv3y1dETyw?= =?us-ascii?Q?suGF9rgRLpvEzCoKv1dOct3bDatFUpD7ZW/FASKHoRbhXyvqi2dGALuwgCKt?= =?us-ascii?Q?CAtGSGNfF8FcLKkok8pCIYqIBVy/AG+eNFhEyOoKrc/SX+MfmwSO11ZQ/ZAd?= =?us-ascii?Q?2nb31QGJ+couJ6LoTXujgX2FHc+CjA0ggFvyNPEyya8ZubcoIi6xN4nwdb/C?= =?us-ascii?Q?XUEIJGYj+cAMG4DgEgLaEUtR+8UwKEtFk5U8iIqqeVVw+TxPhJ3Dt0DpxPI6?= =?us-ascii?Q?bBXJ1gNx8qItf1+dDNZwAMg70P8i48OWgb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q?=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2020 14:23:57.9707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef482642-e6bc-498e-3b58-08d8a2976452 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0bc7f26d-0264-416e-a6fc-8352af79c58f; Ip=[185.231.240.75]; Helo=[relay3.sw.ru] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT048.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5979 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: VE1EUR01FT048.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossPremises-AuthAs: Anonymous X-MS-Exchange-CrossPremises-SCL: -1 X-MS-Exchange-CrossPremises-Processed-By-Journaling: Journal Agent X-OrganizationHeadersPreserved: DBBPR08MB5979.eurprd08.prod.outlook.com Subject: [Devel] [PATCH vz8] ptrace: fix task_join_group_stop() for the case when current is traced X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development <devel.openvz.org> List-Unsubscribe: <https://lists.openvz.org/mailman/options/devel>, <mailto:devel-request@openvz.org?subject=unsubscribe> List-Archive: <http://lists.openvz.org/pipermail/devel/> List-Post: <mailto:devel@openvz.org> List-Help: <mailto:devel-request@openvz.org?subject=help> List-Subscribe: <https://lists.openvz.org/mailman/listinfo/devel>, <mailto:devel-request@openvz.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org |
diff --git a/kernel/signal.c b/kernel/signal.c index 177cd7f04acb..171f7496f811 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -388,16 +388,17 @@ static bool task_participate_group_stop(struct task_struct *task) void task_join_group_stop(struct task_struct *task) { + unsigned long mask = current->jobctl & JOBCTL_STOP_SIGMASK; + struct signal_struct *sig = current->signal; + + if (sig->group_stop_count) { + sig->group_stop_count++; + mask |= JOBCTL_STOP_CONSUME; + } else if (!(sig->flags & SIGNAL_STOP_STOPPED)) + return; + /* Have the new thread join an on-going signal group stop */ - unsigned long jobctl = current->jobctl; - if (jobctl & JOBCTL_STOP_PENDING) { - struct signal_struct *sig = current->signal; - unsigned long signr = jobctl & JOBCTL_STOP_SIGMASK; - unsigned long gstop = JOBCTL_STOP_PENDING | JOBCTL_STOP_CONSUME; - if (task_set_jobctl_pending(task, signr | gstop)) { - sig->group_stop_count++; - } - } + task_set_jobctl_pending(task, mask | JOBCTL_STOP_PENDING); } /*