Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1507981ybg; Thu, 4 Jun 2020 11:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaB29vDxohq/3gQmnxtVNvI+Cff4kcJRoPLfqNqKSPrqUSq56gDyaBgMpio8kROinbrHTX X-Received: by 2002:a17:906:660f:: with SMTP id b15mr4815538ejp.113.1591295208694; Thu, 04 Jun 2020 11:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591295208; cv=none; d=google.com; s=arc-20160816; b=gNsvzOpINS720hMfpckBBTlwQPAtTXUFI03NH9OzTQ7gp70jstTZ3B0PQdT92DTXZM vVy0agOsoCPvls7kAvP0uq3AfG5Oxc47Wzjb9re2sDmq/+Hw/yZNkLMxv/bs2BzgtgKX ZdKxtZc7Achy0k7gmqJy7Di0gP994tTTUXdPG/nGgmIoGZKsBpSIE0qkHKnXHwEkcwot QbykzeNbPmsgzr1Klx9Q02oel/xs9RnIwR+qxp1Sc2/ihR8tgAvDa0D9clIFDmusGFyB tHh2YaOPrTsi7/HnAZTPaBhdF686UoDWYD89401aiGekhD6hHvCfCkBxJvWIgaElr8pl 3MxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qSq4wUWufQz5WnwM7Vp/9oDLcaKXkamSd02ycy/ANwE=; b=HpxTIqZvD46gFe/x+Kpy7VyV/JUvspfcp+owYAK9qjSLrcdX1USs0gxevFCftJQ4bP qkMzhJjCaPkUgTJvasE+JyPiQVDdSjgkzoKMRHsUZou2SSvxCWHnH2tM38gA+ksytUWP alppVf7rezZ1YcTkdG24Qb8CNbl2ko46xpF76OJrrOJkjd/4+hzMTzUU7PMkg4fyQ9UM /6bfWH/zZFO7psi6X+pwjEZJC5G694ENCsapnQ8K7RJ34XH4DVRyjC/bq64n23pJK+5i cqwNqqVY6oCpt06azYZIfCSCwyVFFwlo0KzKZwZdVEAeST8qU/JwsC8cf2lcayiTih7o om2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw6si2012670edb.390.2020.06.04.11.26.25; Thu, 04 Jun 2020 11:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730721AbgFDSYm (ORCPT + 99 others); Thu, 4 Jun 2020 14:24:42 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:31132 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730714AbgFDSYl (ORCPT ); Thu, 4 Jun 2020 14:24:41 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Thu, 4 Jun 2020 11:24:38 -0700 Received: from akaher-virtual-machine.eng.vmware.com (unknown [10.197.103.239]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 210EF402C6; Thu, 4 Jun 2020 11:24:41 -0700 (PDT) From: Ajay Kaher To: CC: , , , , , , , Subject: [PATCH v3] mm: Fix mremap not considering huge pmd devmap Date: Thu, 4 Jun 2020 23:53:45 +0530 Message-ID: <1591295025-1080-1-git-send-email-akaher@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Received-SPF: None (EX13-EDG-OU-002.vmware.com: akaher@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fan, Able to reproduce this issue on v4.19.y using your test program. And as per commit message it fixes commit 5c7fb56e5e3f ("mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pm”) at kernel version v4.5. So, v4.9.y should be vulnerable, however not able to reproduce on v4.9.y. Does any specific scenerio need to test for v4.9.y? For v4.9, modified test program as MAP_SHARED_VALIDATE is not available: - return mmap(NULL, REGION_PM_SIZE, PROT, MAP_SHARED_VALIDATE|MAP_SYNC, + return mmap(NULL, REGION_PM_SIZE, PROT, MAP_SHARED|MAP_SYNC, Let me know if I need to test some other way for v4.9.y. -Ajay