Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1137177rbb; Sun, 25 Feb 2024 22:45:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlHX2AMiYNQl5nOBguL24pFPR/s7rzsb4ddcUab0So2xcbxXise6USFeJxjolA6vunPBA6wtGYcGk9PmVo8Mzj+nhQliv5VBddZGGj6g== X-Google-Smtp-Source: AGHT+IGscj07lLqT5y5hkZ7umiETz78y9Kn+HnIaJfPjcLOWBwigardtWPaEyAGykjl16RymNtP9 X-Received: by 2002:a17:906:1745:b0:a3f:2168:214b with SMTP id d5-20020a170906174500b00a3f2168214bmr5593052eje.1.1708929937883; Sun, 25 Feb 2024 22:45:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708929937; cv=pass; d=google.com; s=arc-20160816; b=rjyqci0cyUZsV8GJVtIZ9aVWKXX2za3fie45w2ZakHrjgZSdezy5n2q3TceI2zyWig Vg8sBKigLnuM/QaFZl5TUgX10CZyVSdvlV98pfsxT/5DfK/PK4QseeBR50XI4NM2tnPk sv9GqAZjTeNX4U3NLBMW8XMcyzK8bpiu1uJIpGwjpqzrUCQQE4h/a78OHT9b40AHgRKB T14UfDn8jvj1kHgqjZ9AV2Pw7tTpLrAgGTPW7xCBxhfy5JNBl8Xq6Pg8HdbYfGp4+GXb nvkVlIgCo5BwdbHTgEmKmmUprPyxP5tRm4vW0Uf6uevBJWQ7cDboTyKq3+NLAVXFrZ9e JVgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=Wtdy2mLkZwun/fVmnq4I9sDqxwvQ1HubAugrjqqUkRU=; fh=siUPFDvNbTRK02rVmzVhNPCzioTdzNXvGkErXd1ZGn8=; b=1LViikud9I+QfoSCBeZ1CEDeP6Ovqpzqc+yNIHDq9Ba2cbvn2IaCjrXdLZWY3iPmHa BYPOoBL4USculzUQXyYWQN5Uq4KPz+wn39qZo1GVMkS/EEbQBUJFf5zQi88a67ubJUui EBG3ivCT+UCxTFHVQ5pdROHSTH1I4XoJptsg53ZvIgb+OM6HQYB0y/3ts6PydxQRzNGy UUvdONoyNMRpuAZoZoXuRuVv21D5jOoZ/WZGX0bNp57NYUR3PIcf7BLzxbJoJvWUrLKq twA53oGjwsYEPNG+iQOpPzu2UHkmOMdrxq/aXZhMjhizhmDu38cbIBShwjwzrkWhOSb3 k/pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-80602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80602-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o12-20020a17090608cc00b00a3e9def21besi1834376eje.445.2024.02.25.22.45.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 22:45:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-80602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80602-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 83B7F1F22E1A for ; Mon, 26 Feb 2024 06:45:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CC201BC4A; Mon, 26 Feb 2024 06:45:27 +0000 (UTC) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817C418E2A; Mon, 26 Feb 2024 06:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708929927; cv=none; b=OpihSQFR9UiM5HP/NWDKrMpWjUxhhVBWoF2/XdNC6LuHEyfI6WjfBhU5tujaAB0FlX5hr9TDRvOC7NIh6lUNsz+Frh8NYc9JLaD1HsovpQ+PRLshbG4dFXeN0Rm7OkcgLZktRJTnM/iFRBj7BEzfq1oXpk64vyiOhdfUUhccFLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708929927; c=relaxed/simple; bh=bG/RoSHx8Aj05SCpiRuRNhObfYppzS0/xR+nU9px41s=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=N5bQ5wmUq0WbGq3NOhlWF+U7LDhh4Hp+84H3LB/yrjtOAx0srWX/mTmUwOIGZHSZYR8ldzB/S7khmUnac3JBGhJ9B1oe/A5Hiba0yU7BFWrRz9mSaszULKSDsIFGUF1rnFoyWjesGAee5XWtia9/YsMSmqhtCJJ9dIgfSkU/ffY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru 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-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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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?