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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 389BEEC01A9 for ; Mon, 23 Mar 2026 09:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gFRxJDdTlxYgQC1pt0o/f4CU4PLqTIwCjrgtfa8Zwzo=; b=J8W0AAg4lJqcRj6KeutE9Idnvg 8mi/sArY+vWYNrixYq4Nx2uxIbXMkX6rCm/JvgGMlQOiZ94p9iwwsX6JcUiWIsnq0MKhKa9oUNASd vfTj201fC8PKuhS99HtQzgGN5rGVi23f3OCUZ8dMvs6JFsGtCrMgYt3/rmvTy4E6AIlw=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1w4bfA-0005kb-7i; Mon, 23 Mar 2026 09:33:32 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1w4bf8-0005kP-To for linux-f2fs-devel@lists.sourceforge.net; Mon, 23 Mar 2026 09:33:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K/Idg58yVGJ7rPFgJI2WsYlcpNKHgP5/otgeXsKnhOc=; b=k7bXSjsrilNsyZ90ouDF5tNBU9 PiSTczQ1wZ/6cpLCLrD2qJZzzfVcxvi6Cgyd7rrraLM6cJaJwEDhW6aq56Nl35q8mgWPxLz2H9WGs HabVkJeWFYIVlslWXkR2fg2MUKl/IOg8A3Wi/M5QEeV/E1P9d7MwTczLikrGbt/IV0y0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=K/Idg58yVGJ7rPFgJI2WsYlcpNKHgP5/otgeXsKnhOc=; b=D28SglvFhZW4iXRjhzCVjVVRqY hPocIsBKCDTVKOs4+n66Xrj7a7XNbLuSJqS78gcUsPYPcrZ58NmneH7YBcqaKlE1xBelJUiJKRwk8 RfZVLrgZw+Tg/4u28Q0mBGYQpDC/1grAtYRuoaF+35N9zC9ZWMlL2tOug9rUop8xA49E=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1w4bf8-0000X7-AP for linux-f2fs-devel@lists.sourceforge.net; Mon, 23 Mar 2026 09:33:30 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 049BE441D7; Mon, 23 Mar 2026 09:33:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70DFBC2BC87; Mon, 23 Mar 2026 09:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774258399; bh=aEC5dWkA0rIyPgo2hxJ9DDKSgMEcqjUjpQZE+kWDD7U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Af3CMvJsRfLjd31u4zatk/jTZVxWTGGMU8Eyj7bop2HOhwGzVyaAjdG/ZYAsJgiBv DVpKvqjbmCQhzCdGJkgXFj/Wz/F77Mg37BGVTMZlhM6Vblsu88rsdjZwh+YAtsoBMy 1jTQtgVcBQnhKsmHYQNeNC+HLwjtVf0heSO+7Mus= Date: Mon, 23 Mar 2026 10:32:57 +0100 From: Greg KH To: George Saad Message-ID: <2026032340-proposal-sedation-7225@gregkh> References: <2026032354-country-saddlebag-5331@gregkh> <20260323090306.757911-1-geoo115@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260323090306.757911-1-geoo115@gmail.com> X-Headers-End: 1w4bf8-0000X7-AP Subject: Re: [f2fs-dev] [PATCH] f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Mon, Mar 23, 2026 at 09:03:06AM +0000, George Saad wrote: > In f2fs_compress_write_end_io(), dec_page_count(sbi, type) at line 1492 > can bring the F2FS_WB_CP_DATA counter to zero, unblocking > f2fs_wait_on_all_pages() in f2fs_put_super() on a concurrent unmount > CPU. The unmount path then proceeds to call > f2fs_destroy_page_array_cache(sbi) and kfree(sbi). Meanwhile, the bio > completion callback is still executing: when it reaches > page_array_free(sbi, ...), it dereferences sbi->page_array_slab_size > and sbi->page_array_slab within the now-freed f2fs_sb_info structure. > > This is the same class of bug as CVE-2026-23234 (which fixed the > equivalent race in f2fs_write_end_io() in data.c), but in the > compressed writeback completion path that was not covered by that fix. > > Fix this by caching sbi->page_array_slab and sbi->page_array_slab_size > into local variables at function entry, before dec_page_count(). At > function entry, sbi is guaranteed valid because the F2FS_WB_CP_DATA > counter is still nonzero (this invocation has not yet decremented it), > preventing the unmount path from proceeding past > f2fs_wait_on_all_pages(). The cached values are then used in place of > the post-decrement sbi dereference. > > Fixes: 4c8ff709c6 ("f2fs: support data compression") This commit id is not in Linus's tree, are you sure it is correct? thanks, greg k-h _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel