Message ID | 202012151712.0BFHCId04029377@finist-co8.sw.ru |
---|---|
State | New |
Series | "vdso: fix VM_BUG_ON_PAGE(PageSlab(page)) on unmap" |
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); Tue, 15 Dec 2020 18:12:57 +0100 (CET) Received: by 2002:aa6:c11a:0:b029:a4:55c9:6120 with SMTP id c26csp3960647lkp; Tue, 15 Dec 2020 09:12:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqK3dyVc8/PyEHNp9JfwjfxIwOje7h78ibLnvGDZbdBewEe4nZJ3KPVRDkpRbeB5pFmqU9 X-Received: by 2002:a2e:b4ba:: with SMTP id q26mr13434704ljm.117.1608052369594; Tue, 15 Dec 2020 09:12:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608052369; cv=none; d=google.com; s=arc-20160816; b=k5nWdp6kGT4A3fK0xc91aBbTiwrNNv0/Ic+o/3CHp4utFA4u6VrWI6W1JYlUa0h/Zy RT99YMs5DBlhaEHrRHeEGfKCn4WPujkUDypgw0LKDLm0e9QnkzQ1C+8J3AkqGBPPeOuL M707qloOvFyl3L9y41HgNE7QIzt6WipyRELl1cojV+gKRaVTlxLm8MkOEarnFC2OwA+F 9m3r2ZCgWMyLC0HF0VGcFSVDHArkO/uHHiVyboZGI8GJkvfFYCnetLcmCQdi/n1oDYqO AjSMpprhpcstV6/Z9BTnu0F2SRH4eaLI8TVZ2kV2PA/4Z9uFphu+qD+IODyKIFwQnPxL nXMQ== 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=M6yi6bU49UDUb1SO5eXLNCRnYeH3t/34qVaS5ZI+vyQ=; b=nbV9N/kAbvJWhOvrxtrWlT7/IoKJROXJeZhlpNk/A7famp7Ihuq73rgI858hoycM1Q DtYJZFi3N/hoSDZMjT3eVrM6JMD/ZS8J3meBSzhPhIcqpbbVme2xiBtWZy2tmFW8mrCo 6EtCIGQ1BZyLpEUBnyoxjlCBmWJLiXrPAVEdHszycveeevLMnIoP3CQOiTGE629ko9km CZoRwZcW9ZEf8P19R2pxA8FcKZy5tXqA7w+zwPqo5VL0zkCBxHNfkcC0DWEx1Hoes6Xg UwCEqhzFE+Yp0hX5v6/IS6C9/C5VFd0YkAY+v/OkDZAfjjy9ydotsF+uq05bspQY04wi 4/cg== 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 i11si7829768ljg.357.2020.12.15.09.12.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Dec 2020 09:12:49 -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 0BFHCZI6003526; Tue, 15 Dec 2020 20:12:35 +0300 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2051.outbound.protection.outlook.com [104.47.6.51]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 0BFHCUJl003513 for <devel@openvz.org>; Tue, 15 Dec 2020 20:12:30 +0300 Received: from DB8PR04CA0016.eurprd04.prod.outlook.com (2603:10a6:10:110::26) by VI1PR0802MB2191.eurprd08.prod.outlook.com (2603:10a6:800:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.13; Tue, 15 Dec 2020 17:12:31 +0000 Received: from DB5EUR01FT014.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:110:cafe::ec) by DB8PR04CA0016.outlook.office365.com (2603:10a6:10:110::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Tue, 15 Dec 2020 17:12:31 +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 DB5EUR01FT014.mail.protection.outlook.com (10.152.4.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Tue, 15 Dec 2020 17:12:31 +0000 Received: from [10.94.5.150] (helo=finist-co8.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from <khorenko@virtuozzo.com>) id 1kpDrt-00D9qh-AB; Tue, 15 Dec 2020 20:12:09 +0300 Received: from finist-co8.sw.ru (localhost [127.0.0.1]) by finist-co8.sw.ru (8.15.2/8.15.2) with ESMTPS id 0BFHCI8b4029378 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 15 Dec 2020 20:12:18 +0300 Received: (from khorenko@localhost) by finist-co8.sw.ru (8.15.2/8.15.2/Submit) id 0BFHCId04029377; Tue, 15 Dec 2020 20:12:18 +0300 Date: Tue, 15 Dec 2020 20:12:18 +0300 Message-Id: <202012151712.0BFHCId04029377@finist-co8.sw.ru> X-Authentication-Warning: finist-co8.sw.ru: khorenko set sender to khorenko@virtuozzo.com using -f From: Konstantin Khorenko <khorenko@virtuozzo.com> To: Andrey Ryabinin <aryabinin@virtuozzo.com> In-Reply-to: <20201215161949.15461-1-aryabinin@virtuozzo.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b3fe3fc3-682a-4156-5a29-08d8a11c9b8e X-MS-TrafficTypeDiagnostic: VI1PR0802MB2191: 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:191; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CzRPqvcZBfozL+J06GMv+T+QItTt4L0liLrXRt2P73dKD3c6urVE8tHWODkc?= =?us-ascii?Q?P56FzOjgKVp1sRe63L0f549S6lFNaPR+CUd9OYdlRYv+3jbpG9s3KgL0gJmV?= =?us-ascii?Q?0Rcrg463lQaQ7hhRsOgAHpddp5+bCQUy1DXg2UgG+VP1UiIeGNhbR4XfL5NQ?= =?us-ascii?Q?tsRvADMCbFBnJffzL4z1AseAhBTvmL7S1DwVwXgegK/Fmnl/Vgcm248hG2i4?= =?us-ascii?Q?ITMMXEOlv3aEVCVkFaTuembbJPC307YM4zldVVCKzkkutGI0EgHYBlauf75D?= =?us-ascii?Q?Ci3xPQP/VRpyJS34uZQUxb2Fr1Zg3PCDRJKTa1gFShx6j3PLHxHFrVrouhnb?= =?us-ascii?Q?+tjkwK2dKolOI062tp4pkBMhXifcSsHL2gR5Z7UPGYzLhXz6mMvsW86P6ZE2?= =?us-ascii?Q?QzOI6m0G3vNzAXXMKx/fgYhHcPQ5sijjT/nocMQ3AvFATyv7pow+t2xTV0ta?= =?us-ascii?Q?BtgIIhJatIfhTNjRKuQuKGhVn7OzKMHiJljtDFOo1b0nwH6iR/qCzoRKsm8+?= =?us-ascii?Q?2+z2Dl55SLyq2guxE1ff8nEQ35B5GKexz5iB1Aa2n07Ps+nG66+qM6E+TeaO?= =?us-ascii?Q?wV1EqCZDXZiuD0S1PWJ1SiuYQAH5n+XOlhe+s0M4UbaDhFVc4bFPr0nkGSpC?= =?us-ascii?Q?F7zEb2x2B3rHfPI/FQOwvzjsN5obvPGe06s6VqbcN4RCeZTS6Z/9wJEVA8en?= =?us-ascii?Q?PCVSSji/jX+VqPq7RWxXPz6cb6oWPGa6pyLvivrWMx6/lWNri18d2bUV+Af4?= =?us-ascii?Q?uiV/oXgRzXeZMeA2ftYlTIeZ1joM37+XDilkB7Svxr674niUX4X3R6SQ9wLI?= =?us-ascii?Q?cw738foS1XrHbjfATeGFwAG9lGIbPVVZHuWIXEMz3SrORtF5U7b819XzqjDP?= =?us-ascii?Q?L1aEqACevnV9CxsNPXwTlKG8T+g7TE6cWoC4RE4q+H5lq58baVJXw60cWERo?= =?us-ascii?Q?RexQcxba6GWPjlblah1XkLz3L370IAsXEX1cYldJOyfzPQjkDWUemtoi+SZv?= =?us-ascii?Q?79L6M3kltCbobMhKJwXVD0qIFkSdkxdgPRW+7e1uebxzkElUckkAa7RvsTU6?= =?us-ascii?Q?iCxSLZdVXKyE3/IKFSqTKaSex6TYamP3uHhlS99CZ7kCLn98ph53nf9z7GgS?= =?us-ascii?Q?rmR0fF15WpzMAllbSQVns5jG8DkSDIQufzJ9G7bRlleVfM76UFA8UyTua7I6?= =?us-ascii?Q?UhJp7IeXCHJHDvqHOV2tNagaWNH3vsEDXzJ2eual+IlmTgDMoMI5cz76jeE2?= =?us-ascii?Q?J868NSe7cJE5L4BoGi4O1QP/vbdAbmkEhOupigbJfrbdVdrLWggHGWtd30Pg?= =?us-ascii?Q?EhpKrpArq0OPVW2SbtmBafZXhafxyYc65O/kju2/6Oc7G+6Yz0xf7VlS18/G?= =?us-ascii?Q?HtrJadVEDmGG72u69C7wZ3pSOqITY/J0Ytz+FNTnPJse9NFLzGKLr7c83kV2?= =?us-ascii?Q?N6JuMtmHXN2OcGAST9IrMmxDrOEheRYTpeEKO5KPme0+Z701Lwn9G4hNhbS/?= =?us-ascii?Q?9GPZXPpmYwBgEyETz1wKH9H+YM7gu4tOBCkVrkj82GR5eZbZGLqcXDggXg?= =?us-ascii?Q?=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2020 17:12:31.3799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3fe3fc3-682a-4156-5a29-08d8a11c9b8e 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: DB5EUR01FT014.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2191 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: DB5EUR01FT014.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: VI1PR0802MB2191.eurprd08.prod.outlook.com Cc: OpenVZ devel <devel@openvz.org> Subject: [Devel] [PATCH RHEL8 COMMIT] vdso: fix VM_BUG_ON_PAGE(PageSlab(page)) on unmap 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 b114e2918bb7..0c6630c6616a 100644 --- a/kernel/ve/ve.c +++ b/kernel/ve/ve.c @@ -568,7 +568,7 @@ static int copy_vdso(struct vdso_image **vdso_dst, const struct vdso_image *vdso if (!vdso) return -ENOMEM; - vdso_data = kmalloc(vdso_src->size, GFP_KERNEL); + vdso_data = alloc_pages_exact(vdso_src->size, GFP_KERNEL); if (!vdso_data) { kfree(vdso); return -ENOMEM; @@ -585,11 +585,11 @@ static int copy_vdso(struct vdso_image **vdso_dst, const struct vdso_image *vdso static void ve_free_vdso(struct ve_struct *ve) { if (ve->vdso_64 && ve->vdso_64 != &vdso_image_64) { - kfree(ve->vdso_64->data); + free_pages_exact(ve->vdso_64->data, ve->vdso_64->size); kfree(ve->vdso_64); } if (ve->vdso_32 && ve->vdso_32 != &vdso_image_32) { - kfree(ve->vdso_32->data); + free_pages_exact(ve->vdso_32->data, ve->vdso_32->size); kfree(ve->vdso_32); } }
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git after rh8-4.18.0-240.1.1.vz8.5.1 ------> commit eac26b43815a2f0ebc2128f9161097bed17bdc71 Author: Andrey Ryabinin <aryabinin@virtuozzo.com> Date: Tue Dec 15 20:12:18 2020 +0300 vdso: fix VM_BUG_ON_PAGE(PageSlab(page)) on unmap vdso_data is mapped to userspace which means that we can't use kmalloc() to allocate it. Kmalloc() doesn't even guarantee that we will get page aligned memory. kernel BUG at include/linux/mm.h:693! RIP: 0010:unmap_page_range+0x15f2/0x2630 Call Trace: unmap_vmas+0x11e/0x1d0 exit_mmap+0x215/0x420 mmput+0x10a/0x400 do_exit+0x98f/0x2d00 do_group_exit+0xec/0x2b0 __x64_sys_exit_group+0x3a/0x50 do_syscall_64+0xa5/0x4d0 entry_SYSCALL_64_after_hwframe+0x6a/0xdf Use alloc_pages_exact() to allocate it. We can't use alloc_pages(), or __get_free_pages() here since vdso_fault() need to perform get_page() on individual sub-pages and alloc_pages() doesn't initalize sub-pages. https://jira.sw.ru/browse/PSBM-123551 Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> --- kernel/ve/ve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)