Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8432040ybi; Tue, 9 Jul 2019 15:46:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUsB2uhxQkucUtPs8qE/ocEb0laIw8/FDzNu5N+dAuG5N3lGfgYPS3nKQkJYP38GiP/HP+ X-Received: by 2002:a63:6155:: with SMTP id v82mr32798683pgb.304.1562712402898; Tue, 09 Jul 2019 15:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562712402; cv=none; d=google.com; s=arc-20160816; b=aWCjOg/WXxblLKV9QRMmMOr3LiWmeCPcy7srYDoY5eXAIbvTTpfXSt5zB5wbVIJxy0 nZN1uXQn2iOAiy8BKR1gyWTAPXM8vCEOzbfZt7HLjGSnUQDkA77pRQJDcKvuS8gWchZF QuTqGUC4kHo4J/w2ctTFwOYckJSF3jMSJreeDB6VGAOmnFm1ji1bbfgPF7Iv6sjuGEaG kgrFXU61OUUIIy+hSedRDbMWnpnS4L7EG4n93fb+s5VbDJINgiRLHL0u6P9iCV7WHchj 8N2jMs0xtyRlYwDdEi0na2QuM7vWL5IwlzI4s0bxs+heOZ5cR5yfKnYPirXQQzkm0cAs ETlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=WmDfProy1Dp6O/d7UXR/pCuB4a9yi2oJwRAiLHXR8FI=; b=Y7seGW4FsKWW/2iCF5a6E8WvtDeabknbbF49MlREjH5kGtkZZoCCy3OMdzsL8YEOis 37vKd6KwcElx2eRyf6Azz6GrDEZwcWkSvV0Tt00QanqL52T8O8RPh4eNHTizsfPIdKgZ OkCDyxD4P2EGTn1CTOHhB3EFwRh1XEDsSypoLdQOMMRUc+vanEqqanh5H+rHyfnA9/WE X4NKO+RCMgMptBZ/rfPt+ZKsMdYW5qWjxL2lUc2ib3R1KoVbHYZT4/pI59aVazCFjy6i GEroQzTn3Yjnm85juwarCqbXczBeKD2b3NFhrhFNQHudtN09s8FxiDMq/Vk5sYoAIkG0 9iqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=THZRHUUf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si261167plb.38.2019.07.09.15.46.27; Tue, 09 Jul 2019 15:46:42 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=THZRHUUf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbfGIWgK (ORCPT + 99 others); Tue, 9 Jul 2019 18:36:10 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:1978 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfGIWgK (ORCPT ); Tue, 9 Jul 2019 18:36:10 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 09 Jul 2019 15:36:08 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 09 Jul 2019 15:36:09 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 09 Jul 2019 15:36:09 -0700 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 9 Jul 2019 22:36:09 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 9 Jul 2019 22:36:09 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 9 Jul 2019 22:36:09 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 09 Jul 2019 15:36:09 -0700 From: Ralph Campbell To: CC: , Ralph Campbell , Andrew Morton , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , "Kirill A. Shutemov" , Mike Kravetz Subject: [PATCH] mm/hmm: Fix bad subpage pointer in try_to_unmap_one Date: Tue, 9 Jul 2019 15:35:56 -0700 Message-ID: <20190709223556.28908-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-NVConfidentiality: public Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1562711768; bh=WmDfProy1Dp6O/d7UXR/pCuB4a9yi2oJwRAiLHXR8FI=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Type: Content-Transfer-Encoding; b=THZRHUUfPOzbOu0G+mUFBwdXTkVaIRyYUhTmyBN+kxFrZrkuCZMB0QIbsgRmMgdxv fhWfhYtObglVZpAYUg9wae+eqbuKmR0WpWK1LgzKnYNDm90H4nC5PYbjMibG+FexFY ws73FQ7OyJbc5tGO4q0fM3859mCHmEWKlrqf/SNrUFffaP+vIxlTvmLpXnU87yW+LE GDaFsFG9TOopI7e6oMVFJP+A2eSqnP7NlydABKF5OpHYbq6I2XMDctzEZpY/8Ocvbt 3kYpx8pU7JykioEa0fCpomdY+HONkVJg0Q0yDCVmmeO9IL42bJ2OA6u2X+0WLdnjKn Ki52Yfw+aFsCQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When migrating a ZONE device private page from device memory to system memory, the subpage pointer is initialized from a swap pte which computes an invalid page pointer. A kernel panic results such as: BUG: unable to handle page fault for address: ffffea1fffffffc8 Initialize subpage correctly before calling page_remove_rmap(). Signed-off-by: Ralph Campbell Cc: Andrew Morton Cc: "J=C3=A9r=C3=B4me Glisse" Cc: "Kirill A. Shutemov" Cc: Mike Kravetz --- mm/rmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/rmap.c b/mm/rmap.c index e5dfe2ae6b0d..ec1af8b60423 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1476,6 +1476,7 @@ static bool try_to_unmap_one(struct page *page, struc= t vm_area_struct *vma, * No need to invalidate here it will synchronize on * against the special swap migration pte. */ + subpage =3D page; goto discard; } =20 --=20 2.20.1