Message ID | 20221110151702.1478763-1-peterx@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp207108wru; Thu, 10 Nov 2022 07:19:05 -0800 (PST) X-Google-Smtp-Source: AMsMyM6e7BTBFZm8XFAIkhqgZvJw7uCKwJWoZreG3rhzSGEhy1CAbKy0VQxAPBlTmpWhJ+s5g7G9 X-Received: by 2002:a17:907:761b:b0:7a3:86dd:d330 with SMTP id jx27-20020a170907761b00b007a386ddd330mr59138780ejc.34.1668093545722; Thu, 10 Nov 2022 07:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668093545; cv=none; d=google.com; s=arc-20160816; b=i1GRKaRpnPFEwz+AjYocvjcGHfxwaa2wtw6gv9N9mksMV5qsyu5gvHy4INqvN3rcWo mbiMywd7aRZYCCUlDFBxB3CfjP5Ata9slAZaguozqttuxS7Er0m1xWFiOemvGOzXLObd fM8kkQm9shY+9f6OJu4uH1z+bMCQZI61zALn2aTpNcKcWyBbMnL2XnL6/qGd4AHXoojL 0aSGiCCJFkSqGUE+zZgYvLjgonPgGc94b5pRQc4gGYJg/pBGmZfubRRsV/fprihEEXP2 k5K6wRWpXmy1MGrC9XFwxJ1wFrZMC3+sTKNLwVcRFHboQfT3TjjoaF3RzxOg5ExuwDGo sQ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7JBMRlhf9SKM85chgVsRyacqS8HRqg/wt0F6XTSTiUc=; b=MpPHYZXr6/Zs2ae+mH0CI9nyp2dgNTvk60FV3m+g2oGNf4ZPpLgKpGIFDy9icQ5m0K UVY5Irg42FLph6X927ZgKdtDYxpHJhk1kK9oDFp4B+53ofdINMnu1A0y+FcJWCCg5zZY 5h7wHVdeM9brC35+bNz6T7So9Y+smy2/wbNI4XVz3hSd7uQ0hEN+c47MRBfHV5T9GtnL IkZXJvv8+ikQwUtZkm4ekEweZ0JPsvGsaPzupuGBPZc7DEYNGgOoicl4Zdvyhx1wX4rY QBiqQyIZOVGCa4ofyoU6prhd9DlLTYS/8pBPH+2YlJlResnCHEEkxx/ezFa/l8Dallfn 1NXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PoS7cdSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi9-20020a056402550900b0045d0c00ead2si16861704edb.157.2022.11.10.07.18.41; Thu, 10 Nov 2022 07:19:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PoS7cdSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231392AbiKJPSI (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 10:18:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbiKJPSE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 10:18:04 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 689021F603 for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 07:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668093426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7JBMRlhf9SKM85chgVsRyacqS8HRqg/wt0F6XTSTiUc=; b=PoS7cdSoPGBjXaIoBfpa8RORfTEsjgyvcLRzqMhJRSXr25rXhXr95NOKGKWEHoojjOfQbX UwZgv8vzOkiJXs6sH0PT5b72vrz+Frwv0AEYFSC+NyD4Yu2D0bMrzPiSltHa1YBp+lSX+a tXTIn0ntfFDCCnqhZsEsCNDjsOW15pU= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-98--oy63Y1sMxGpnJToral-LA-1; Thu, 10 Nov 2022 10:17:05 -0500 X-MC-Unique: -oy63Y1sMxGpnJToral-LA-1 Received: by mail-qv1-f72.google.com with SMTP id mi12-20020a056214558c00b004bb63393567so1659100qvb.21 for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 07:17:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7JBMRlhf9SKM85chgVsRyacqS8HRqg/wt0F6XTSTiUc=; b=aNO4Pf9K02LAArxADzPbtygXhj35FriENZq9xh1Q/nzwb0cvm19kApjFUTHvfXzc8D ywvJFInOYo+c/kvUYU+W53KCjmhBp19ZbBhZ1LHndl3O6iUmPnceUc1p3HmjOU1mYACH GnE+PeUrtXLqm0LtI8XWWkSO+OIU5Booxl9d28P7yEzErpif/DbhUg0S7ZC1CEHpmrIr rPVW+3z/5wxNC5fhqaE5atQlEMsJxvYXDb+LRo+LE481gL+yzFNKR2MEBFttKl7BJXTz dlxID15Raw58KnFuW8vsDHF1xtqOhNZCcMyFlaPbroxEO9FCBrE7MBC3dPjJz3Z+04dG ej8w== X-Gm-Message-State: ACrzQf3a5GdLBiSjVTCCwUeEdDoUg0iazAxeXbr3DNnDC2qKAw1QDlmi nJBAnwgBy+c/TQ4Pt14QpKfqkAai7+zmngtbnGBYZgWU1TtkAgBVMrHhK4h+6eUsiu6BagFIkh1 4SRco7euPNKL+QcypZxM6cUsF X-Received: by 2002:a37:5384:0:b0:6f7:ee90:1618 with SMTP id h126-20020a375384000000b006f7ee901618mr48361039qkb.117.1668093424724; Thu, 10 Nov 2022 07:17:04 -0800 (PST) X-Received: by 2002:a37:5384:0:b0:6f7:ee90:1618 with SMTP id h126-20020a375384000000b006f7ee901618mr48361002qkb.117.1668093424292; Thu, 10 Nov 2022 07:17:04 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id l19-20020a05620a28d300b006ec771d8f89sm13621596qkp.112.2022.11.10.07.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 07:17:03 -0800 (PST) From: Peter Xu <peterx@redhat.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>, peterx@redhat.com, Nadav Amit <nadav.amit@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Axel Rasmussen <axelrasmussen@google.com>, Andrea Arcangeli <aarcange@redhat.com>, Ives van Hoorne <ives@codesandbox.io> Subject: [PATCH 0/2] mm/migrate: Fix writable pte for read migration entry Date: Thu, 10 Nov 2022 10:17:00 -0500 Message-Id: <20221110151702.1478763-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749122857924924147?= X-GMAIL-MSGID: =?utf-8?q?1749122857924924147?= |
Series |
mm/migrate: Fix writable pte for read migration entry
|
|
Message
Peter Xu
Nov. 10, 2022, 3:17 p.m. UTC
This comes from a report from Ives on using uffd-wp on shmem. More information can be found in patch 1 commit message. Patch 2 added some more sanity check when walking pgtables and when we convert the ptes into other forms e.g. for migration and swap. It will make the error trigger even earlier than the user could notice, meanwhile nail down the case if it's a wrong pgtable setup. Ives, I only attached the reported-by tag for you but not tested-by because the fix patch (patch 1) has a slight change compared to what I sent you before, but hopefully it should also work for you. If you want, feel free to reply directly here if the patch also works for you. We probably need patch 1 for stable (5.19+). Please have a look, thanks. Peter Xu (2): mm/migrate: Fix read-only page got writable when recover pte mm/uffd: Sanity check write bit for uffd-wp protected ptes arch/x86/include/asm/pgtable.h | 16 +++++++++++++++- mm/migrate.c | 8 +++++++- 2 files changed, 22 insertions(+), 2 deletions(-)