Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2788721pxb; Mon, 25 Apr 2022 02:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx8RiFYwhX1kljYcoe0+s6QRr8VntTlyfX67W7YwiWsONjKeXIrYePSiHP1b+/q6ty28eh X-Received: by 2002:a65:6aa3:0:b0:3ab:23fb:adae with SMTP id x3-20020a656aa3000000b003ab23fbadaemr5118239pgu.278.1650878821527; Mon, 25 Apr 2022 02:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650878821; cv=none; d=google.com; s=arc-20160816; b=hiXPrj9wHVNhLiOW2jmVHKdk92anNoSdOujP4GtqWdabHp8GuY1/IfN8FuUpzawU0P 4BHZkWzow3AZu/YliI88lVZJJPRSYPx300ropApsoEIhiwFGO0c+ewKKAwoPkKDOPZ2R z3CUzfIcclmLjjV760gRvpWko1eHhNXtS1hmjaan6DFvqh058jyNECzVGVQGp8REJAcx zBUywBKQCSBH9Oib07YGUljhGpkP3+tcE6E7Jxy2yll//GctWYTSg+nP2epqqPSxkMGv cHFZIETZxokB7IijxTkhjeCOh8nS4rnpLY9aIfzSvIJttujfES55br37q6HV0oDI03Ff e9zQ== 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=L2azMQHMUFrbG2E5PYpPP6rZZX5nqn4uOOcirt5ed5s=; b=ZpoyabDsLgccCPe53sDIxlcw9+j9QCju5ZM/WQu3Cc8odLHOGWPj8BJ/6pxcZNzZ1q r5VjbGw95GIFnmFFBdIHjTKcfRuu5uV5DkGqbyCmAYukpiKVJ7KnY/MJa4WsyZyVOBCm xNY49HFpMPFsY5Ckgpxtf5GW6DQPixSgFq7bOf+o8B87U4b+5rIcoYmr/CYcudOGJ2fi G0YklEKrjNbJO4XVCE6NjlyuXDshIKabk9H1DE5FmpUWU/czgmPJDnyxzfBTHe+hH0m7 HuDbGKi3+QJSQIcu4K6uRH9c1utmDFlSfcD2IfvDzTI6PD7E1CyhOfuZqqA1No0bucMF IddQ== 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 m3-20020a170902db0300b00158dd22994dsi1548028plx.93.2022.04.25.02.26.47; Mon, 25 Apr 2022 02:27:01 -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 S240352AbiDYCXi (ORCPT + 99 others); Sun, 24 Apr 2022 22:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240320AbiDYCXe (ORCPT ); Sun, 24 Apr 2022 22:23:34 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD286BC8A for ; Sun, 24 Apr 2022 19:20:26 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KmpdB0qyQzhYgg; Mon, 25 Apr 2022 10:20:14 +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 10:20:24 +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> From: Miaohe Lin Message-ID: <159b4ea1-7f39-0486-8e2e-2843e1ebbe2a@huawei.com> Date: Mon, 25 Apr 2022 10:20:23 +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: <20220425010804.GA3746096@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: dggems702-chm.china.huawei.com (10.3.19.179) 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 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. Thanks! > > Thanks, > Naoya Horiguchi >