From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1664C3A59C for ; Fri, 16 Aug 2019 10:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84548206C2 for ; Fri, 16 Aug 2019 10:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565949675; bh=M6ip3bq2JhOCPbBCQnkiBxY+S61Bi0fxJqvrSqHdfE8=; h=Subject:To:Cc:From:Date:List-ID:From; b=m/s1BwQbiDf436QqUmI8YVzNXZQrnVav0gfFLLrQqaVVHkBmkRMD+/x9tyTRnsSgb KhouJdAQrLcUul6M4EhC3eohhb0fUxETffxb5Dd2jgIRB+XbEkL/GAxf/fz9uaxuot atqvB245Vdy3XaTcKTS56HOp6bPKbcy4Q79ZXfmk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfHPKBP (ORCPT ); Fri, 16 Aug 2019 06:01:15 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:56725 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfHPKBO (ORCPT ); Fri, 16 Aug 2019 06:01:14 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 771082A3D; Fri, 16 Aug 2019 06:01:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 16 Aug 2019 06:01:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=pYV7z/ zN1znYNhXnaDHZi82HGW6WTuePuf0h1sTgB9A=; b=TLNW8qx7ugbMcGFcWJs0PQ clp4fzlUefaJxJ1YmeqeX78WTPeoeQ6Bc+BH9H8TbWtpg2/jS0Fw5qY1wc1WL6Mf mcAHrpE/TsLKKKCqo7ne8P+EvbsqahdohjxIzYXccqkh7jA60hveBNjwY6K07rpI XAMxpAb9ExindnBVAdaETuR7PyT0NxjQd1OGhgwv3OF413YWUaamKrG4nfXwiDiu fgKGfpKMwA4BSdWbDgFhNYCgMe2SRQ2Ybi0xGev9QvG5oKQIoLn5iSr/Whh57AjW CQK/MO8yM/C8LezRA+Igc69H5qColtMOCDub/2Fb+6VVChFoK8OKkOAOEqNSjayw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeffedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtjeenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepkeefrdekiedrkeelrd dutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomhen ucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 82CE58005A; Fri, 16 Aug 2019 06:01:10 -0400 (EDT) Subject: FAILED: patch "[PATCH] mm/hmm: fix bad subpage pointer in try_to_unmap_one" failed to apply to 4.14-stable tree To: rcampbell@nvidia.com, aarcange@redhat.com, akpm@linux-foundation.org, aryabinin@virtuozzo.com, cl@linux.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, hch@lst.de, ira.weiny@intel.com, jack@suse.cz, jgg@mellanox.com, jglisse@redhat.com, jhubbard@nvidia.com, jiangshanlai@gmail.com, kirill.shutemov@linux.intel.com, logang@deltatee.com, mgorman@techsingularity.net, mhocko@suse.com, mike.kravetz@oracle.com, penberg@kernel.org, rdunlap@infradead.org, schwidefsky@de.ibm.com, stable@vger.kernel.org, torvalds@linux-foundation.org, vbabka@suse.cz, willy@infradead.org Cc: From: Date: Fri, 16 Aug 2019 12:01:08 +0200 Message-ID: <15659496684516@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1de13ee59225dfc98d483f8cce7d83f97c0b31de Mon Sep 17 00:00:00 2001 From: Ralph Campbell Date: Tue, 13 Aug 2019 15:37:11 -0700 Subject: [PATCH] mm/hmm: fix bad subpage pointer in try_to_unmap_one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When migrating an anonymous private page to a ZONE_DEVICE private page, the source page->mapping and page->index fields are copied to the destination ZONE_DEVICE struct page and the page_mapcount() is increased. This is so rmap_walk() can be used to unmap and migrate the page back to system memory. However, try_to_unmap_one() computes the subpage pointer from a swap pte which computes an invalid page pointer and a kernel panic results such as: BUG: unable to handle page fault for address: ffffea1fffffffc8 Currently, only single pages can be migrated to device private memory so no subpage computation is needed and it can be set to "page". [rcampbell@nvidia.com: add comment] Link: http://lkml.kernel.org/r/20190724232700.23327-4-rcampbell@nvidia.com Link: http://lkml.kernel.org/r/20190719192955.30462-4-rcampbell@nvidia.com Fixes: a5430dda8a3a1c ("mm/migrate: support un-addressable ZONE_DEVICE page in migration") Signed-off-by: Ralph Campbell Cc: "Jérôme Glisse" Cc: "Kirill A. Shutemov" Cc: Mike Kravetz Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: John Hubbard Cc: Andrea Arcangeli Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dan Williams Cc: Dave Hansen Cc: Ira Weiny Cc: Jan Kara Cc: Lai Jiangshan Cc: Logan Gunthorpe Cc: Martin Schwidefsky Cc: Matthew Wilcox Cc: Mel Gorman Cc: Michal Hocko Cc: Pekka Enberg Cc: Randy Dunlap Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds diff --git a/mm/rmap.c b/mm/rmap.c index e5dfe2ae6b0d..003377e24232 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1475,7 +1475,15 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, /* * No need to invalidate here it will synchronize on * against the special swap migration pte. + * + * The assignment to subpage above was computed from a + * swap PTE which results in an invalid pointer. + * Since only PAGE_SIZE pages can currently be + * migrated, just set it to page. This will need to be + * changed when hugepage migrations to device private + * memory are supported. */ + subpage = page; goto discard; }