From patchwork Fri Jul 19 18:46:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 11050511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B127314F6 for ; Fri, 19 Jul 2019 18:46:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A64F428842 for ; Fri, 19 Jul 2019 18:46:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AA5B28991; Fri, 19 Jul 2019 18:46:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC44528842 for ; Fri, 19 Jul 2019 18:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A41B06B0006; Fri, 19 Jul 2019 14:46:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9F8966B0007; Fri, 19 Jul 2019 14:46:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B70C8E0001; Fri, 19 Jul 2019 14:46:57 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 523D46B0005 for ; Fri, 19 Jul 2019 14:46:57 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id y15so22588856edu.19 for ; Fri, 19 Jul 2019 11:46:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=2aJECj3eYGevQmg0uKx5hyTjnYdcvQINQrWdu7rO77g=; b=VjYxbgaZikLh3qFEg8o6Cwjwx/YwicnEfRYNWNFGUGT3oszesKwTBsfGUlNPG6J3S8 RUPrEXX9j5+QJE3FuTJJQs3AnZ6JAmupgWH/r1R/BcD7pDTkUasn01FeOd5AAfTZh+9f ZWnBQGphd6O2NMrDWbKzD8EmfgjTVVKmAXQT2IMxNeq9Veiksph8zNurkmkIYQd8vpXr LhxpZkG4VT+Gp9h5fO8akrdrLUQ6O+bnEJZT7FQvyIW4BMXAl6vEbAJiA6cA3ywQk2wq 9MCpna7KxBV3PjIXCNDEp8MEUDKOCNYV/iGXQK0qHlsPDZy4Kw4PqA2Cd13JYxDKyYaG BZug== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org X-Gm-Message-State: APjAAAVjRvmSlpxb/kq+VcylNyWj8NfZGS2c8UpvsnIuSBj8hZ8socHM sWjbVuGuDKFEAQr/uVR7/HEeAkr8ik1SfCyh5yZ6ZeiuciM0sWAiKdO5djW8kd3fZMPgJMYEG+U FkVNO9e/udbBypSwKA9ochC2vqo/YJM8XHz/AryhWDwnKRqNu9XJ6kp9LDcyyvakmCg== X-Received: by 2002:aa7:c999:: with SMTP id c25mr47613566edt.134.1563562016814; Fri, 19 Jul 2019 11:46:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7xqxx1bSF4IMUjq2dkaqWvfGDZbW9hCIypQvr8bQ2e7FyhS/bIXJ2Chm9kvFWbatXBG/5 X-Received: by 2002:aa7:c999:: with SMTP id c25mr47613492edt.134.1563562015789; Fri, 19 Jul 2019 11:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563562015; cv=none; d=google.com; s=arc-20160816; b=013AlNApxuDUdaAHLO8jk7Fousiq4fAums0TuvWOePol6BbNf7H7Dmj9XEpk8GzobE 6c6xh06Ox2RcHv6eh2RX0nfOiPmiyD0UFhOjYHwFE1v7p7s7VXDavylhCNI3QDDECXdv s3O+P9Ey4f7eTyZFVRkD5IRfWj5gOCo94rE+7pY6OMxdKFKKlGBWPeyrkYS/NBzmUukm p6EuRurZi5PzSxfhN+dUVi0264rtio1io6eqlKxfCygml08vuzvI4R0Y6TJKenObFRP8 GLM1p4j2ZnorRlzb24X/uj3Fg/FRCjA1ZD+nldQN4CGcHKWKOx8Rve/NTqQ4UXXHjMVN UpJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=2aJECj3eYGevQmg0uKx5hyTjnYdcvQINQrWdu7rO77g=; b=ExWWc6KRqs2+OM5+C4A5RMk87D4azD14X15W4cX0YuioWmjIw6y/jHDiwPE+Jk19U3 Ijw5ZlHjGbFItupwUCq0s12eM2BjYpB7NN6MDAkCNtNdskyrXSUHZCCNUQaa3S6lV2lb jfq5JLS+8CigV6YV3+4BRiFc4sFgkPQuvX2yv1ydl9GohScV//+XOJHjsNExeC++6uKt xcAzYmqxCSsn3ZrbVufl1O57e4jYm50RdrXn4zW9oH1rqF85mhYTbvdoMnIFwoBEkzrW GpFxvTC5MGGAGTf6RqkYiKgJkBgyRm9lgtASIwehWpmkFbM4FQBFxPGS7jG6e652Ifv7 piTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id s50si91564edb.270.2019.07.19.11.46.55 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 11:46:55 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id 7592122E; Fri, 19 Jul 2019 20:46:54 +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 0/3 v3] Sync unmappings in vmalloc/ioremap areas Date: Fri, 19 Jul 2019 20:46:49 +0200 Message-Id: <20190719184652.11391-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Hi, here is a small patch-set to sync unmappings in the vmalloc/ioremap areas between page-tables in the system. This is only needed x86-32 with !SHARED_KERNEL_PMD, which is the case on a PAE kernel with PTI enabled. On affected systems the missing sync causes old mappings to persist in some page-tables, causing data corruption and other undefined behavior. Please review. Thanks, Joerg Changes v2 -> v3: - Moved the vmalloc_sync_all() call to the lazy vmap purge function as requested by Andy Lutomirski - Made sure that the code in vmalloc_sync_all() really iterates over all pgds (pointed out by Thomas Gleixner) - Added a couple of comments Changes v1 -> v2: - Added correct Fixes-tags to all patches Joerg Roedel (3): x86/mm: Check for pfn instead of page in vmalloc_sync_one() x86/mm: Sync also unmappings in vmalloc_sync_all() mm/vmalloc: Sync unmappings in vunmap_page_range() arch/x86/mm/fault.c | 15 ++++++--------- mm/vmalloc.c | 9 +++++++++ 2 files changed, 15 insertions(+), 9 deletions(-)