Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2758963rwd; Fri, 19 May 2023 09:46:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5244T8THZe6Ig7tHEBPj0sYAKsZY/9u8N/k0e5LGrQK2uU5RuJj+Nb9PdQq6+uC2ZLjy7e X-Received: by 2002:a05:6a00:ac4:b0:64a:5cde:3a7d with SMTP id c4-20020a056a000ac400b0064a5cde3a7dmr3966576pfl.27.1684514819094; Fri, 19 May 2023 09:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684514819; cv=none; d=google.com; s=arc-20160816; b=Tw8IHyhqm5zTqrVWH6V2ZLsCiYnJv2cIIViNuAKapxa6+LRNMtxkBlIrYZypscTmOy 3UoyxJK7iulUTyHy0hXiC43X2UF31EaYa2XJo7ws8eDy3zbPCtQj8zlBgvrBfezLr8+N BYdersWFFewl7TBMn+eqxRK1egp4TkihG/4tlVY0HsA4AnkgSvXuhexaoAR/o0NhCb3W BmtiMDIgWQEss6EAOs8MAQ3YVAsYUrIREpeqwMy7gnO++Ku9Py4rX0esmio0oC1iM+j5 qksC89QmRb5jjMawLF29oMYkQtZLasvj+IQfR4J1yIzl16c6H2R19BYuDd5t2GwQ3XbV ciuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tm5yWitQFobo7XTUh5Htl9d+/ov6l57MkDLyYMRoUF8=; b=EeyJX0C3SenjFLZH9mcQeGCNLhKTEeIJthGlGCLzT+Q4BoFPCO09IHkxv76hsJg8ee Izv7LjAjHDiwo0Gm1nlMLPfc8vRbeLqnmdlL158QV1VanLFxapOtOPtxVMNsbjlvogvj smwn5mPVg5Eiqx1QsoRyC3q7HCt/2hjUMJxsp8f0TR0iauyCi1UcDv6gVafRChdwDBw+ 6+0MkJk+kh+CMg9FcLeHKlCJ+kIO1FJd6iYfxQw4iCSXY/PQnNqjeyN+AreYdfRJAzDl 1K04TM2wGAECxNq/QtPavgVTXEd0BHPocSwgw6EmjqCnhYkd3UJlUCYyrKiu2ePskWHl LGQA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020a639509000000b0053425243529si4166606pgd.323.2023.05.19.09.46.45; Fri, 19 May 2023 09:46:59 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjESQjY (ORCPT + 99 others); Fri, 19 May 2023 12:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjESQjX (ORCPT ); Fri, 19 May 2023 12:39:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6226EC9; Fri, 19 May 2023 09:39:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F2BAB65935; Fri, 19 May 2023 16:39:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75B3DC433A4; Fri, 19 May 2023 16:39:18 +0000 (UTC) Date: Fri, 19 May 2023 17:39:15 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: Qun-wei Lin =?utf-8?B?KOael+e+pOW0tCk=?= , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "surenb@google.com" , "david@redhat.com" , Chinwen Chang =?utf-8?B?KOW8temMpuaWhyk=?= , "kasan-dev@googlegroups.com" , Kuan-Ying Lee =?utf-8?B?KOadjuWGoOepjik=?= , Casper Li =?utf-8?B?KOadjuS4reamrik=?= , "gregkh@linuxfoundation.org" , vincenzo.frascino@arm.com, Alexandru Elisei , will@kernel.org, eugenis@google.com, Steven Price , stable@vger.kernel.org Subject: Re: [PATCH v3 1/3] mm: Call arch_swap_restore() from do_swap_page() Message-ID: References: <20230517022115.3033604-1-pcc@google.com> <20230517022115.3033604-2-pcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230517022115.3033604-2-pcc@google.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 16, 2023 at 07:21:11PM -0700, Peter Collingbourne wrote: > Commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") moved > the call to swap_free() before the call to set_pte_at(), which meant that > the MTE tags could end up being freed before set_pte_at() had a chance > to restore them. Fix it by adding a call to the arch_swap_restore() hook > before the call to swap_free(). > > Signed-off-by: Peter Collingbourne > Link: https://linux-review.googlesource.com/id/I6470efa669e8bd2f841049b8c61020c510678965 > Cc: # 6.1 > Fixes: c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") > Reported-by: Qun-wei Lin (林群崴) > Closes: https://lore.kernel.org/all/5050805753ac469e8d727c797c2218a9d780d434.camel@mediatek.com/ Acked-by: Catalin Marinas