From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAD41C48BF6 for ; Mon, 26 Feb 2024 06:45:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B299940012; Mon, 26 Feb 2024 01:45:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 264046B016B; Mon, 26 Feb 2024 01:45:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 150D2940012; Mon, 26 Feb 2024 01:45:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 063426B016A for ; Mon, 26 Feb 2024 01:45:20 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C68F114048E for ; Mon, 26 Feb 2024 06:45:19 +0000 (UTC) X-FDA: 81833018358.12.B2BE2B8 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by imf02.hostedemail.com (Postfix) with ESMTP id BE43A80002 for ; Mon, 26 Feb 2024 06:45:16 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of r.smirnov@omp.ru designates 90.154.21.10 as permitted sender) smtp.mailfrom=r.smirnov@omp.ru ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708929917; h=from:from:sender: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: in-reply-to:in-reply-to:references:references; bh=Wtdy2mLkZwun/fVmnq4I9sDqxwvQ1HubAugrjqqUkRU=; b=cGyPLjF3OGETjkSxuiAar//og10DDVfsX/pxV0tb9QWvWBZPJCzFWNl5DW4VmVXKeft6Di 3HvLV4H8oYM/eVXxEiQWI7JPRDH5D3rTEVCcre3nA+RTpiU2J2IGpwxup9Ls9Sj6xrd2pI X0C1nGRa1b1We/4KZx77CPZo+Qb5kUQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf02.hostedemail.com: domain of r.smirnov@omp.ru designates 90.154.21.10 as permitted sender) smtp.mailfrom=r.smirnov@omp.ru ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708929917; a=rsa-sha256; cv=none; b=YHr4e5L76uZlyVzPyoMtT2Ma0H309OyIulYUkjfCm6qUunxOSpwnDPZQxfs3Op5rOGh9KX Wfvv1dGqggralO+/DYN70a21bT0SHPRenkXSp28y274SITFIgsUkcPv4xLcxcA5TdjCBKJ nZLHlfusg/sEHaiBIV1o/TSSX8AvFdU= Received: from msexch01.omp.ru (10.188.4.12) by msexch02.omp.ru (10.188.4.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Mon, 26 Feb 2024 09:45:13 +0300 Received: from msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753]) by msexch01.omp.ru ([fe80::485b:1c4a:fb7f:c753%5]) with mapi id 15.02.1258.012; Mon, 26 Feb 2024 09:45:13 +0300 From: Roman Smirnov To: "stable@vger.kernel.org" , Greg Kroah-Hartman CC: "Matthew Wilcox (Oracle)" , Andrew Morton , Alexey Khoroshilov , Sergey Shtylyov , Karina Yankevich , "lvc-project@linuxtesting.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 5.10/5.15 v2 0/1 RESEND] mm/truncate: fix WARNING in ext4_set_page_dirty() Thread-Topic: [PATCH 5.10/5.15 v2 0/1 RESEND] mm/truncate: fix WARNING in ext4_set_page_dirty() Thread-Index: AQHaXoZYls/GR/0zTEaYvL5Vg1anPrEcPxk2 Date: Mon, 26 Feb 2024 06:45:12 +0000 Message-ID: References: <20240213140933.632481-1-r.smirnov@omp.ru> In-Reply-To: <20240213140933.632481-1-r.smirnov@omp.ru> Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.188.4.41] x-kse-serverinfo: msexch02.omp.ru, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 2/26/2024 4:56:00 AM x-kse-attachment-filter-triggered-rules: Clean x-kse-attachment-filter-triggered-filters: Clean x-kse-bulkmessagesfiltering-scan-result: InTheLimit Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: BE43A80002 X-Stat-Signature: s53xtwwcuw4dhx6jdfufz8spt6r53k1h X-Rspam-User: X-HE-Tag: 1708929916-868352 X-HE-Meta: U2FsdGVkX1/fk3tq80fRPMRRIFO3SFqbK2B0ngbvP974U12TcGqCkEAy5xTRJZlkiHpOxNzo+WFVJrowGcXJnv/DvNb7/vpVbD7SyDxwQazxIBKYiX8eCYGt4Hpv6oEoezW75ZoZlIP5rSw9pVUpxZESlRvnFPokSvHrddwxCyPebriI35zugrtqDFXrxwM7/i8BBoq2udeALz662tO1fyhp2K7mwhpWvare6FOmZk8SS7MT5haSihYjNAuOo/6zgR9dKJk2ytmQb3zt8Qnxf40KxNa/zx9HRzlQZ9zXCfACrX5QIaqb2/aOizeBBnDpBzAkcJMLUOLNUlL+IqkC6E6XULOUpatcFxi94zO/QeyJLMy8rleoAFT96obxOr6dquVqxtkp9DVeKK57EPn6GsVyJK3+YpLAiJfbQ4HLxXu+HY7kYGlGM9kbEif4oTHfvfUUF9UigxhqmVHaxWdRoP76gdEnBwT8LPJImdPQBRV65gHgskmzww6ABa/qzc3Y4E7sVIN/LAyBYmqgxq/Wze0RP21y0M/TRxzFIFhX0wq3rtxAniit9eDbkllIlp5YsCj+Li+PsqMJ2TBaW0gxseo3rzLEdcoPO6aea3OS8SwuchziAt0s9q0y+YyjsnDN7vbfHjsXpRc3FvYu/o9YtkN+W0otALiyy2+d+mxKRZXqpljT8a36WUErehRqffzqEOw0XdXlXG/o3BsLGB7WBaqC7BLzg2dHr8PNXbvHrWlxP4ucFCESASN/DAskEZa4zPU36TwWAwXmbv7EmH02m4NrVjvL85mMOr68Zb3c+lopmcGyM+yPsIeNTjy2Lrgxvnc+LkkS47ILBBPCuMsm9qyny6FOPa1SlitYzweKaYZVVC6syMpqy1ps9DUcVqNabyVd5JWuiVxrGoy00W4j7gVs+zvby3GRz7djp8eQoxZ7URTeWDesQQwxkP2ZbFxdP1cn45lQJ0u6P1va+Ud Jf9K4yzq BPLzBYt7pgw5xXNY77HsnOKwPGa3lHgDlvdEbH3Aa6XBIJETrCnqLIJEnoVIfrsMFti0wHTj7SbH4qnVP3FIIlbb+EVz8mYLhxEoe X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, 13 Feb, 2024 14:09:33 +0000, Roman Smirnov wrote: > Syzkaller reports warning in ext4_set_page_dirty() in 5.10 and 5.15 > stable releases. It happens because invalidate_inode_page() frees pages > that are needed for the system. To fix this we need to add additional > checks to the function. page_mapped() checks if a page exists in the > page tables, but this is not enough. The page can be used in other places= : > https://elixir.bootlin.com/linux/v6.8-rc1/source/include/linux/page_ref.h= #L71 > > Kernel outputs an error line related to direct I/O: > https://syzkaller.appspot.com/text?tag=3DCrashLog&x=3D14ab52dac80000 > > The problem can be fixed in 5.10 and 5.15 stable releases by the > following patch. > > The patch replaces page_mapped() call with check that finds additional > references to the page excluding page cache and filesystem private data. > If additional references exist, the page cannot be freed. > > This version does not include the first patch from the first version. > The problem can be fixed without it. > > Found by Linux Verification Center (linuxtesting.org) with Syzkaller. > > Link: https://syzkaller.appspot.com/bug?extid=3D02f21431b65c214aa1d6 > > Previous discussion: > https://lore.kernel.org/all/20240125130947.600632-1-r.smirnov@omp.ru/T/ > > Matthew Wilcox (Oracle) (1): > mm/truncate: Replace page_mapped() call in invalidate_inode_page() > > mm/truncate.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Hello.=20 Sorry to bother you, do you have any comments on the patch?