Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp500524ybi; Wed, 17 Jul 2019 00:17:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3rwTD+kCAkNx+XWIAbfn0qqtq6qII7iQJ5jNGvOB9kIm+8rZOqP8KDtsl71zZTVhwTU1U X-Received: by 2002:a17:90a:b394:: with SMTP id e20mr41834469pjr.76.1563347847924; Wed, 17 Jul 2019 00:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563347847; cv=none; d=google.com; s=arc-20160816; b=VdYk7xDelqB+WVaeniIYdFItddpe/DSIcoZ0HrzCuJXkyMaOMt97wqYIyoWOkpI8AX bBcFAxMivrg+S1MATNHOFIGOMwb88OPx6q/Nlpj7ZT5uL+dYAaEY1kRRK6F2ckEa7+Ge yMhbG2da+QHFBovfORWcDmtzwVWj2UFeNiq5b6IilUMUUlj0dzLFZ0Ua2O2SEbDs3e2k 90NvDbh7AHkHiVt0JNjn+dIfcDhIi/zFkdC4GnO78S401UoPcPSrhVmO+0bWYfuWkyf3 RUPKzLl9lqfR/5U3zDVza4XmbMMIVkES89+M6VNNYFcHRnZzETwmzxJ+Feva3FOh8SI0 9hiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Lnw+NdhmEcJZRPrRGQsYyVpoRNapOiKu9LqdRSkFBI0=; b=uEEq6D2R5EW7XQJAVLPyALuzYqqfqPOAUfMbf+OdAw5zocPpsxCyRCsOFQonoZ+aw6 yLVjRE/SB3tH0tC5ZtKoinN00gn/t2iV1G9Mb0H83rXr0hcJkz8diyYAM/OLJwr/c0oO LAKN+/suhM9Lm+/OWzItwz5QQuGXZwpvyHu0BSBIBbfi5QwlxybMyY26mGfKghYB1+X6 Y2PEbrGVPetAlfs5bpl96+AvnbbLnvLFu/UNPF8tKnJVW70y/GKeCJ4jMN76tyOWKDkm Ksik0a5+ZSMz4M9hv73vsNSgfDMqyO5lr2CVYUtAfQ+PhpBELCpCKilxm+t88tSiWqqd REPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si16018930pgc.402.2019.07.17.00.17.11; Wed, 17 Jul 2019 00:17:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfGQHPD (ORCPT + 99 others); Wed, 17 Jul 2019 03:15:03 -0400 Received: from 8bytes.org ([81.169.241.247]:35662 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbfGQHOy (ORCPT ); Wed, 17 Jul 2019 03:14:54 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 2231D476; Wed, 17 Jul 2019 09:14:52 +0200 (CEST) From: Joerg Roedel To: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joerg Roedel Subject: [PATCH 3/3] mm/vmalloc: Sync unmappings in vunmap_page_range() Date: Wed, 17 Jul 2019 09:14:39 +0200 Message-Id: <20190717071439.14261-4-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190717071439.14261-1-joro@8bytes.org> References: <20190717071439.14261-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel On x86-32 with PTI enabled, parts of the kernel page-tables are not shared between processes. This can cause mappings in the vmalloc/ioremap area to persist in some page-tables after the regions is unmapped and released. When the region is re-used the processes with the old mappings do not fault in the new mappings but still access the old ones. This causes undefined behavior, in reality often data corruption, kernel oopses and panics and even spontaneous reboots. Fix this problem by activly syncing unmaps in the vmalloc/ioremap area to all page-tables in the system. References: https://bugzilla.suse.com/show_bug.cgi?id=1118689 Fixes: 5d72b4fba40ef ('x86, mm: support huge I/O mapping capability I/F') Signed-off-by: Joerg Roedel --- mm/vmalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 4fa8d84599b0..322b11a374fd 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -132,6 +132,8 @@ static void vunmap_page_range(unsigned long addr, unsigned long end) continue; vunmap_p4d_range(pgd, addr, next); } while (pgd++, addr = next, addr != end); + + vmalloc_sync_all(); } static int vmap_pte_range(pmd_t *pmd, unsigned long addr, -- 2.17.1