Message ID | 202010291403.09TE37cw014332@vz7build.vvs.sw.ru |
---|---|
State | New |
Series | "ve: Reorder ve->ve_ns assignment in ve_grab_context()" |
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, 12 Nov 2020 11:41:00 +0100 (CET) Received: by 2002:a9a:2f:0:b029:91:d28a:c332 with SMTP id 44csp382585lka; Thu, 29 Oct 2020 07:03:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1s22AUVTl9j1f1E+MgEHrjGPEm0VgRDk4igqVV0uKg1BxEEOuKsF+mSHgR47jrtTGUrXa X-Received: by 2002:a2e:3a08:: with SMTP id h8mr2005293lja.125.1603980217782; Thu, 29 Oct 2020 07:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603980217; cv=none; d=google.com; s=arc-20160816; b=SSHPvKoMZjusJT82+tU74AWpFk6W7A+BHEZ5YwcMEg4r/hSxTUymkaa0RfPl3fqA1b JsyufTVj4e9V/SjSGpDkZBKLduJ+CCc1w24OTWaHW0cyl2vponuEninFjq6I6f0KkfRl xql1Qz5mdZ0c3B5/RALWfCsdPE4DDy6XIn75wKM6hkI6g+UOU50Q6D7yHFOarkE8jmpj q0ClRzM8PVXDI7pWg1pip6U5LZ4s0/5OR/LG6F546pJpOuKjS6mVpipaUaXCh/icbXm3 Hbqr7J9YQnoTMTEn/JBXoXizUFTv8MGIwFBN3SyGYxck/WLpCb+hVs5hNrbWCX2/INhG N6hw== 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 :cc:mime-version:in-reply-to:to:from:message-id:date; bh=9zYVpymDhz6+evZFqJp/jaSsigtkKBtNW9uHDcxxRLg=; b=frXy+srqXsWQxW/vycjHurMAKN+XdyhdetkWAs2E1UynWXKRsOUwGSNxoqTOz4JAuq tE365Cp/aOvSRavlkvhhwLCSI3E9ZtwgOMekMpE1s3/z5YjrWEcEdCIKCWZkZbhSKcAh k1nG9sFPBygXgP5dkRHWkMvR1CAKUpa6Z28qyAMMdpKQbUlicFy/sYXcjxlwKM2u8Stg wUMHjpaNbP8Xa0YzderAqbGhx8m/dWdcLEcAq7tfZev+Mgn6wD9cuq0fmbOHHDIDwHKE AuCx4DGTAZA2P9i6OYw51MKHh4TZusrwZdsXusk4S01Nv7ej4uQPg93DVn4xXtiV5Tik F5jQ== 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 b23si1446087ljo.93.2020.10.29.07.03.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2020 07:03:37 -0700 (PDT) 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 09TE3LPT016834; Thu, 29 Oct 2020 17:03:21 +0300 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2109.outbound.protection.outlook.com [104.47.18.109]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 09TE3JF3016831 for <devel@openvz.org>; Thu, 29 Oct 2020 17:03:19 +0300 Received: from AM5P194CA0011.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::21) by VE1PR08MB5087.eurprd08.prod.outlook.com (2603:10a6:803:114::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Thu, 29 Oct 2020 14:03:22 +0000 Received: from VE1EUR01FT050.eop-EUR01.prod.protection.outlook.com (2603:10a6:203:8f:cafe::45) by AM5P194CA0011.outlook.office365.com (2603:10a6:203:8f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Thu, 29 Oct 2020 14:03:21 +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 VE1EUR01FT050.mail.protection.outlook.com (10.152.3.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Thu, 29 Oct 2020 14:03:20 +0000 Received: from [172.16.53.199] (helo=vz7build.vvs.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from <vvs@virtuozzo.com>) id 1kY8WB-006hNE-4P; Thu, 29 Oct 2020 17:03:07 +0300 Received: from vz7build.vvs.sw.ru (localhost [127.0.0.1]) by vz7build.vvs.sw.ru (8.14.7/8.14.7) with ESMTP id 09TE371u014333; Thu, 29 Oct 2020 17:03:07 +0300 Received: (from vvs@localhost) by vz7build.vvs.sw.ru (8.14.7/8.14.7/Submit) id 09TE37cw014332; Thu, 29 Oct 2020 17:03:07 +0300 Date: Thu, 29 Oct 2020 17:03:07 +0300 Message-Id: <202010291403.09TE37cw014332@vz7build.vvs.sw.ru> X-Authentication-Warning: vz7build.vvs.sw.ru: vvs set sender to vvs@virtuozzo.com using -f From: Vasily Averin <vvs@virtuozzo.com> To: Kirill Tkhai <ktkhai@virtuozzo.com> In-Reply-to: <160397120820.901411.10282626598028535392.stgit@localhost.localdomain> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 33f4ff68-12d6-4e15-de7b-08d87c13649d X-MS-TrafficTypeDiagnostic: VE1PR08MB5087: 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:451; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?TeaZBzgkEmoNJhnc4eB0rAXOTj9dUhlIPNeg0r71iB1E4Pzj0LCdMllzY5Rf?= =?us-ascii?Q?Yx5ybogBpPzpjzwkbiB5J/LLE+DDeBtVt1Yn1PkbHizXLv7WPyPsepVXdw3u?= =?us-ascii?Q?8GfnOi3gBiZO9v2r/yookOeJLRJooVjQUz9xOfI2WFbGMpNli1aVXyDjosqW?= =?us-ascii?Q?56S2EDnDYmEh6FkUl366kVvu7I+QcuRKjvdKIDH9AUGApHgYL3A/klGbr8tw?= =?us-ascii?Q?6BM+MmW3i1S6zs/w6OZFJURODFjZRKy9IIl7FAnaUTZirxzVhf0g8s8gBJTK?= =?us-ascii?Q?mTZoekUWOoMllO6o5PWcj5TTfeIIoh4ZwT0GiU74L4Ak4mjm+EE1lzVhz/2K?= =?us-ascii?Q?AKceWSR5nH7ALocydrTIFgE57TyhkSA24O0zxOyR9ipybyUg9a8HOVK9atBf?= =?us-ascii?Q?Q8rZ5Jzi4GmQ5pX+lIefJbY50Fplvr7wjBrbXwjQDtY6PB2zSUf7Jxkxux7T?= =?us-ascii?Q?SjHHeHIT1rDemdUrGAaH1etUQHlRELI7WKDVpFt+EQxVpfQZ/T4Zp3bptOYQ?= =?us-ascii?Q?6Rfvzl2luWWB7aV9aK/Npkx2ufOrygNwlDAFv/yUwz+PsnXcZS9SkEjNJVBV?= =?us-ascii?Q?ubXresYfSjeLv9Y2XyuKAf3VRtcvV8GCn+4bSkLIZz0/ctMNEspWRvB8Gz3s?= =?us-ascii?Q?l33MCV3WLXqvObfahduIzwZ8KHYXpUaYSR5XKBmG+wNTTDz9gSxZSYZ/exnx?= =?us-ascii?Q?IzE0eTEX8bRVxEBmZf0B+Z4TEkU/el0xn0857wBA8EUtdST1Itz9EnlBqyZn?= =?us-ascii?Q?0Y8RjJD8sZXfQ11s5lDQCot+yvY1rKfIIj474yWs5sU8xEbglnC0cwi66OLK?= =?us-ascii?Q?dmYc2Bs4KAp6ZtKCmhpBpaMJOuizOP2IC98/BtexxA67CdHcK9H77iHpNOiN?= =?us-ascii?Q?t6lyscYkhBeQYZ26ZQC/r5mJ/0n1vkLjGidHL5q2L786KuWr7RthnDEc2gfG?= =?us-ascii?Q?L2RheOOjX7OUaC6dMeJXXmxbV2edxRULE5ski4icHwX/nbOvtwZDL1XXTfHT?= =?us-ascii?Q?Hn6qeGDBAbL8ae9ByPWmT3sIsRGwc6c/U5yZlP0QR9sDRFbaVWw0G08Mxs69?= =?us-ascii?Q?YpCOMY87ykgzYhVMNAtZx3Z+jSXt/V5XiYD5nwW3csQYeGVoYt5cDMlsDd52?= =?us-ascii?Q?GUnKOMW9mOn6NZILADlVtk7sCebo57T2UpGAGeqmusxmOjgs+zfEuN+eMndI?= =?us-ascii?Q?VBZrN9S+/AbYkicPGLqAWF6PQXIPpcV7ffVKnvIfwiqrdS1O/WYTmEAFOHE?= =?us-ascii?Q?=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2020 14:03:20.7135 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33f4ff68-12d6-4e15-de7b-08d87c13649d 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: VE1EUR01FT050.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5087 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: VE1EUR01FT050.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: VE1PR08MB5087.eurprd08.prod.outlook.com Cc: OpenVZ devel <devel@openvz.org> Subject: [Devel] [PATCH RHEL7 COMMIT] ve: Reorder ve->ve_ns assignment in ve_grab_context() 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/ve/ve.c b/kernel/ve/ve.c index 482d658..ff3bf93 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -586,9 +586,10 @@ static void ve_grab_context(struct ve_struct *ve) ve->root_css_set = tsk->cgroups; get_css_set(ve->root_css_set); ve->init_cred = (struct cred *)get_current_cred(); - rcu_assign_pointer(ve->ve_ns, get_nsproxy(tsk->nsproxy)); ve->ve_netns = get_net(ve->ve_ns->net_ns); synchronize_rcu(); + + rcu_assign_pointer(ve->ve_ns, get_nsproxy(tsk->nsproxy)); } static void ve_drop_context(struct ve_struct *ve)
The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh7-3.10.0-1127.18.2.vz7.163.41 ------> commit 089cdc112a232fa6cbdf59f2fee40b58563c67f1 Author: Kirill Tkhai <ktkhai@virtuozzo.com> Date: Thu Oct 29 17:03:07 2020 +0300 ve: Reorder ve->ve_ns assignment in ve_grab_context() This function must provide guarantees for readers, that "ve_ns != NULL" under rcu_read_lock means the rest of context (say, ve->init_task) is stable. But now order is wrong, and it does not guarantee that. Fix it. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- kernel/ve/ve.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)