Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2700922pxb; Sun, 24 Apr 2022 23:52:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIPuvuTtGinDv7lL+6coHRYe24bMCnSYQ5L5Xaw7nPI4cPhCTztDaKHG5Bzfucq7M0gn5A X-Received: by 2002:a17:902:bb90:b0:156:2c05:b34f with SMTP id m16-20020a170902bb9000b001562c05b34fmr16910555pls.53.1650869542094; Sun, 24 Apr 2022 23:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650869542; cv=none; d=google.com; s=arc-20160816; b=YOa6nKLblBMVvDkfOwWVDgRhjPS5EXCZgMoF6gPY5ZiSj+6q7OLx2z6yvQqZOQfLpd pa9VuCZbW444bM4G1+0mX1cQBqlb6it/XGJ8xPguAq8VeZhHZFH2SdNwWPnBCvrMkhYO 7mmfYukFtWnA3IsZRBEpCGfxPdz6XeFlzuHGoo6SF+9lveyvfk9F8j+qZE5/OT+gTO4l qTUZL8nXKb5SrmZFdowqncBzRRL768nWVK2FOIS2A4EASGUQcL5b2/tNNQ6FKQvhNKkd Z/wCI4rfAronW52Qm4XSZ56ewzRrrnhOx4WntysqJFBbRM4wGZ0+uwoJqoHF1WKtAQrG hDWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=TJAedQu49pM4J3XDqbEXfpJ+QBEzmYo0TL1enGKj5Yg=; b=skMfnruXyMn90ANOA0hgqUV6NqP956HtlNixBl3MU84NMDkkEoYTQD+wwlspe68JNf PhQbkriYfvy9/5dDGm7vcpLSMxgNrp7319eJVk0syTu2Sa97kI059Lmi3Q1MFdZxqvnA U6hhu8o27ZYPfb6k58Tpca51+E2U+Hmuh6iH8C60jAWBiZyjJixY2MaELP424+nk8iP+ ICdoLLHCXRzPscKtCYVJ/nCGb4i0P/Zqst1bsC/tNxAbFJvSK+wKpSqibvsCLSnSvfzw P2U9vvpgN3Xz74XpojtKzMHwd8m2T5HkDaDKf1qQhocVenN7oKurLpgbw7fbUnZTGfWn FdAA== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m16-20020a637110000000b003ab4280ada7si2254921pgc.106.2022.04.24.23.52.08; Sun, 24 Apr 2022 23:52:22 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240566AbiDYDON (ORCPT + 99 others); Sun, 24 Apr 2022 23:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233642AbiDYDOC (ORCPT ); Sun, 24 Apr 2022 23:14:02 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD62051339 for ; Sun, 24 Apr 2022 20:10:55 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KmqlQ4ZhbzhYgt; Mon, 25 Apr 2022 11:10:42 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 25 Apr 2022 11:10:52 +0800 Subject: Re: [PATCH v3 1/3] mm/swapfile: unuse_pte can map random data if swap read fails To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: "akpm@linux-foundation.org" , "willy@infradead.org" , "vbabka@suse.cz" , "dhowells@redhat.com" , "neilb@suse.de" , "david@redhat.com" , "apopple@nvidia.com" , "surenb@google.com" , "minchan@kernel.org" , "peterx@redhat.com" , "sfr@canb.auug.org.au" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" References: <20220424091105.48374-1-linmiaohe@huawei.com> <20220424091105.48374-2-linmiaohe@huawei.com> <20220425010804.GA3746096@hori.linux.bs1.fc.nec.co.jp> <159b4ea1-7f39-0486-8e2e-2843e1ebbe2a@huawei.com> <20220425025117.GA3752903@hori.linux.bs1.fc.nec.co.jp> From: Miaohe Lin Message-ID: <76b28d03-2315-061b-60e1-c35fd0e524ba@huawei.com> Date: Mon, 25 Apr 2022 11:10:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220425025117.GA3752903@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 2022/4/25 10:51, HORIGUCHI NAOYA(堀口 直也) wrote: > On Mon, Apr 25, 2022 at 10:20:23AM +0800, Miaohe Lin wrote: >> On 2022/4/25 9:08, HORIGUCHI NAOYA(堀口 直也) wrote: >>> On Sun, Apr 24, 2022 at 05:11:03PM +0800, Miaohe Lin wrote: >>>> There is a bug in unuse_pte(): when swap page happens to be unreadable, >>>> page filled with random data is mapped into user address space. In case >>>> of error, a special swap entry indicating swap read fails is set to the >>>> page table. So the swapcache page can be freed and the user won't end up >>>> with a permanently mounted swap because a sector is bad. And if the page >>>> is accessed later, the user process will be killed so that corrupted data >>>> is never consumed. On the other hand, if the page is never accessed, the >>>> user won't even notice it. >>>> >>>> Signed-off-by: Miaohe Lin >>>> Acked-by: David Hildenbrand >>> >>> Hi Miaohe, >>> >>> This bug sounds relatively serious to me, and it seems old, so is it worth >>> sending to -stable? >> >> This bug is really old but it's never seen yet because swapoff is supposed only to >> be done before rebooting the system. But swapoff can happen anytime. Poor guys might >> come across it and get wrong data. So I think it's worth sending to -stable. >> >> BTW: This patch should be revised in order to go to the stable version. > > I sometimes have the same wonder, but I'm not sure about the rule. If you > choose to send another version, could you update subject line (subject line What I mean is that SWP_PTE_MARKER is newly added and it will conflict with the stable version. So this patch might need to be revised for specified stable version in order to fix the possible conflict beforehand. Or that should be done when it goes to the stable ? > is supposed to show what the patch does rather than what the problem is). If a specified version for stable is required, I will do this. Thanks! > > Thanks, > Naoya Horiguchi >