Message ID | 202012031231.0B3CVv26011236@vz7build.vvs.sw.ru |
---|---|
State | New |
Series | "ms/tracing: Fix race in trace_open and buffer resize call" |
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, 03 Dec 2020 13:32:26 +0100 (CET) Received: by 2002:a05:6520:2ded:b029:a0:46db:f129 with SMTP id v13csp70744lks; Thu, 3 Dec 2020 04:32:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0aKM3wfLOZ6uAlpGYSWYXV0VmW00DjsDvPYvZmCxHF/YxB+Uq9aY2YUFqckQqVDf/s5j+ X-Received: by 2002:a19:6753:: with SMTP id e19mr1154862lfj.425.1606998739825; Thu, 03 Dec 2020 04:32:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606998739; cv=none; d=google.com; s=arc-20160816; b=YLlffXJzhThrZAvBO1m0W54r3ZJa8MCUNL2RnYD2PwqNENUYPJB/N9gPFO4X9YPjHY /6nFq2gTx7fa0+JRgn8raDqBturKuXMcvlu6ad74X2oNWHMkuHriaGfQgJ2SUG7jbByp d+7tzIQM4j/mjv1FxWmxAxc6VmpG3gSOhsd/EuddqFP2jJvWKfB10SGjxmLHXVuNUJdV LiRuuLl680c0A3uEz9uh3+Nd8o/twy52NjsxL0d3JllIGvQM3hYGMIvQEjLYviUXw0Mj fNX/M6bUmnTCuAfDvRa+oVsNfUDLrP+WS9x0xhioNSh3Q3HKRGmEbuMBEP3snbpVk7NG zxkA== 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=/ualV75+6pvVCTrB7VryuVl5rsUj34UvbWjxyd5lnRo=; b=uWEjQ8sy9R7X3Zj31xYi7oWA+ujiQbZ5Qt7ni1z/Rdxwz/S7wGRQbpRWn0zhPxjg9Q Z+fVcZJMpAjO+61ysGFFVDozh0BYBk/N/FQUbTHa4zfHjIPIqL3hNV/+LwG3F2gPg6ZD 2sA8zEbMTsHFgZRTRIRWvUBbGqoobtvcWrx2nmCoegx5RT4LyTjTJYqG56OrTAQ7M/Rk Oyy9r3b7q8BcFLXEo+HAaE6aS4QzzMH8XwldaKpQSPHlWVLMaXCWRAXwIUnFFBgus8yf odORImUwVOtPPRCGLMyxr0okN6v8SevkaoMWNjPcR13c1rGOms+hOp58DvTt3vtfH1PH lcCA== 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 b9si888725lji.229.2020.12.03.04.32.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2020 04:32:19 -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 0B3CW1uf028491; Thu, 3 Dec 2020 15:32:02 +0300 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 0B3CVx3H028488 for <devel@openvz.org>; Thu, 3 Dec 2020 15:32:00 +0300 Received: from AM6P193CA0122.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::27) by PA4PR08MB5885.eurprd08.prod.outlook.com (2603:10a6:102:e6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Thu, 3 Dec 2020 12:31:59 +0000 Received: from HE1EUR01FT039.eop-EUR01.prod.protection.outlook.com (2603:10a6:209:85:cafe::a) by AM6P193CA0122.outlook.office365.com (2603:10a6:209:85::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 12:31:59 +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 HE1EUR01FT039.mail.protection.outlook.com (10.152.0.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 12:31:58 +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 1kknm8-00BZWN-Ts; Thu, 03 Dec 2020 15:31:56 +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 0B3CVvlh011237; Thu, 3 Dec 2020 15:31:57 +0300 Received: (from vvs@localhost) by vz7build.vvs.sw.ru (8.14.7/8.14.7/Submit) id 0B3CVv26011236; Thu, 3 Dec 2020 15:31:57 +0300 Date: Thu, 3 Dec 2020 15:31:57 +0300 Message-Id: <202012031231.0B3CVv26011236@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: Vasily Averin <vvs@virtuozzo.com> In-Reply-to: <dd8d4480-3090-bc30-1068-21d923f25db0@virtuozzo.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0a18f891-61da-448e-b49d-08d897876d7c X-MS-TrafficTypeDiagnostic: PA4PR08MB5885: 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:1388; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?5y5mWGT7Kqxvd7UnTcs8RkVbBvTsqTda+SmWXZQWsDYQ23X6ceHBEdUdmJX7?= =?us-ascii?Q?4BZDRXl/bSRmNXlawcVVsaLUbhI6Yi1/vooo1zFB1rAhudkT4SrulP99njfN?= =?us-ascii?Q?/WotE4dcw6AwXUskINJIyQMnJGidm+vWtQcTCBgNR35RtFf+9BbgzKSA+d/c?= =?us-ascii?Q?6JzN9IJ8VjBm6p6IPd2gTF1p3lrqu5Pnu+w1xcGCsstqI/LRTjnoO4Avqiaf?= =?us-ascii?Q?hTaKGNjvQRyZGbO2WBaqcgLr5gwAQGl5ODLJNWp6w7V2RoNR5NjwdUETNfLU?= =?us-ascii?Q?yvuF7wSxoPuVWQO8TuhkbFT1ylnxOAwDkaRegq+p8PgUcd1Cl+plOdpEkx1t?= =?us-ascii?Q?RjFfzbOOh9jPftbwXhqeLyPs2tMe/gjSrrWeerob+O13SOdWvSKtoP8leT9e?= =?us-ascii?Q?YrTbkZ2lYDJru+z+wFnwc5HuIE2joM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ascii?Q?vVDFWf42kXL0KDNLEHaWm4U58IVeVwSiKd8mvBGxVdEulAF+mpo5qvV80mbP?= =?us-ascii?Q?vH1wgwiwQz2gNi6tJ9BxUCdhVQehzHJL97759urEyLG0gB5ln5TWSk+toMZO?= =?us-ascii?Q?aE6GNRWJxnRvhBmpOVip4PpyWQ864mf1YTAYSN7xS5S1Lwd7LTxj0Ub8GTUq?= =?us-ascii?Q?0tqd8F7livzBPFs=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2020 12:31:58.6163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a18f891-61da-448e-b49d-08d897876d7c 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: HE1EUR01FT039.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5885 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: HE1EUR01FT039.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: PA4PR08MB5885.eurprd08.prod.outlook.com Cc: OpenVZ devel <devel@openvz.org> Subject: [Devel] [PATCH RHEL7 COMMIT] ms/tracing: Fix race in trace_open and buffer resize call 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/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 8b3df28..7b1afd1 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -4170,6 +4170,9 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) if (!cpumask_test_cpu(cpu, buffer->cpumask)) return; + /* prevent another thread from changing buffer sizes */ + mutex_lock(&buffer->mutex); + atomic_inc(&buffer->resize_disabled); atomic_inc(&cpu_buffer->record_disabled); @@ -4192,6 +4195,8 @@ void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu) atomic_dec(&cpu_buffer->record_disabled); atomic_dec(&buffer->resize_disabled); + + mutex_unlock(&buffer->mutex); } EXPORT_SYMBOL_GPL(ring_buffer_reset_cpu);