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 00C48C55184 for ; Tue, 4 Aug 2026 02:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Type:Content-Transfer-Encoding:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:References:To:MIME-Version:Date: Message-ID:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=segessSckpRvNmDw+b0dJAo0HUOlTVZse1ZMwVZ+vjQ=; b=aMnYKoZ/0vDSEc2jH7YQxXhDON 6G3t9C9MO+YafkcX374X+qhE72RFTst2EuFkZ8gliKISWHVwlkRahwaQaJvlCb0jjn1+oX5onerQu Ly7oEw43t2w1cLkuGj4lk0jw9/iyvdkAiVMeTfW141Z+s0jgI8tXq/8CTm+QT9YIyFM4=; 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 1wr5Jv-0002O8-OM; Tue, 04 Aug 2026 02:55:57 +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 1wr5Ju-0002O1-8t for linux-f2fs-devel@lists.sourceforge.net; Tue, 04 Aug 2026 02:55:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:To:Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=9sMXVCVRu6HkzwiLjNbUtN5xbg/2Po9gPBpf4aBtlhk=; b=F+IwusQHMfH9PnY4jBdiWh/4MG YBGD01ia8DADhNyzAD3nyD7qdleCLY3ktXWMK2u3eGBz6RSta15muapGaPCoRkE6wyeEXVI1c8Z/L aK7VZbUd25cHKItq4bEuu6YwLfe4cvj44Ls/z5F8I3nKSPuPRFe2D7DvAEY92UqphrsQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To: Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: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=9sMXVCVRu6HkzwiLjNbUtN5xbg/2Po9gPBpf4aBtlhk=; b=ZY9tc2lZYAcX4PMA+sz7Ihbhfy i12b74QqVhC6Ig4YwhmNekNcmegfdHicGZ+xRbCGDXOglo3+XjM04t093VxcqJuC0fvCcO/CxryhB UwJKo4W5DuLr+d6PFOhqlN18hUY/2ufuBDDeQ6nX54Jyo4yj3FqMcqcYL2LPcYO8dz9I=; 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 1wr5Jr-0006XJ-A3 for linux-f2fs-devel@lists.sourceforge.net; Tue, 04 Aug 2026 02:55:55 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id CFBF54051C; Tue, 4 Aug 2026 02:55:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F2FF1F000E9; Tue, 4 Aug 2026 02:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785812149; bh=9sMXVCVRu6HkzwiLjNbUtN5xbg/2Po9gPBpf4aBtlhk=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=IbsyfEhWdyJwXHx+q52Yuu987fYew+OPeVwIks2N2vWLlIOfZ2/xzZWREYj5cWTYv 8SiGu/dw5pX+wlkZebD80zk7A/Tu/P1ZcU6lSCVhgmDpBX8YhgWRoDWt0ITrMt0j/4 18QXYy2OLUNryOkuFv/bp6jSTrgbn03adcminAm0iTX4XUCq/lr7VHJGef1OPIrHYf U0m/fOCD+abTL2UbmYJgUF4E++rwXCCi0ABSgbbvK5hsKReZnpBv5ClZab/zXrM3Z3 hqinhb1VuOOUvLz6xFLPzYZhRwN419HEYJIj09WZrOM6mygJ0RTpd631NcXdkTsYwd TMgwigcSzeS1A== Message-ID: <81d7efa2-8e60-4f92-9cf0-613f6116756c@kernel.org> Date: Tue, 4 Aug 2026 10:55:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Wenjie Qi , jaegeuk@kernel.org References: <20260804014849.1942326-1-qiwenjie@xiaomi.com> Content-Language: en-US In-Reply-To: <20260804014849.1942326-1-qiwenjie@xiaomi.com> X-Headers-End: 1wr5Jr-0006XJ-A3 Subject: Re: [f2fs-dev] [PATCH v4 1/2] f2fs: avoid NULL checkpoint thread access in sysfs 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: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com, stable@kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 8/4/26 09:48, Wenjie Qi wrote: > checkpoint_merge can be enabled even when no checkpoint merge thread is > running. A read-only mount is one case: f2fs does not start > f2fs_issue_ckpt there, but ckpt_thread_ioprio is still writable through > sysfs. > > The ckpt_thread_ioprio store path updates the saved ioprio value and, > when checkpoint_merge is enabled, calls set_task_ioprio() for the > checkpoint thread. If cprc->f2fs_issue_ckpt is NULL, that dereferences a > NULL task pointer. > > Protect ckpt_thread_ioprio sysfs writes with s_umount as well, so the > checkpoint thread cannot disappear under the store path while updating > its ioprio. > > Fixes: e65920661708 ("f2fs: add ckpt_thread_ioprio sysfs node") > Cc: stable@kernel.org > Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 35683386422 for ; Tue, 4 Aug 2026 02:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785812151; cv=none; b=tnunFq0aYm3Djv3kAv24CUdxRRNa95SW/fCynxX52swOYQoOe6QvTp8imnRKVwzbqk0D75nIGxFJPAhpPWZ2KN9lQ4U1SWkHHk3uf3RpJs7Uw1XN34MbcXlje56sQSd5emDPrg78GIlxbd8GkvG4OMoKv925P+t51Qx3gD2Fu+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785812151; c=relaxed/simple; bh=Bjvi8ZgC8z094Tj6fyV6a9CJfqn0NQhZ4I/ihyu0BR0=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Yj8992BqjnjKeNV9NiopT+V20NaIBZdoGoS2cfAU1qB7DyTHtPInVsgndp6vsgIPlSmN0mqKo5d8nyPvqWtRou1po+XlBqmRNLCNzJv7j3ZVjniJ0mYL8I+Kq2AG3dUyWhT4Xt6uHMOb2dMbgKOPiR0YLMsm6dux6YvRKe9s/aI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IbsyfEhW; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IbsyfEhW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F2FF1F000E9; Tue, 4 Aug 2026 02:55:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785812149; bh=9sMXVCVRu6HkzwiLjNbUtN5xbg/2Po9gPBpf4aBtlhk=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=IbsyfEhWdyJwXHx+q52Yuu987fYew+OPeVwIks2N2vWLlIOfZ2/xzZWREYj5cWTYv 8SiGu/dw5pX+wlkZebD80zk7A/Tu/P1ZcU6lSCVhgmDpBX8YhgWRoDWt0ITrMt0j/4 18QXYy2OLUNryOkuFv/bp6jSTrgbn03adcminAm0iTX4XUCq/lr7VHJGef1OPIrHYf U0m/fOCD+abTL2UbmYJgUF4E++rwXCCi0ABSgbbvK5hsKReZnpBv5ClZab/zXrM3Z3 hqinhb1VuOOUvLz6xFLPzYZhRwN419HEYJIj09WZrOM6mygJ0RTpd631NcXdkTsYwd TMgwigcSzeS1A== Message-ID: <81d7efa2-8e60-4f92-9cf0-613f6116756c@kernel.org> Date: Tue, 4 Aug 2026 10:55:46 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, stable@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com Subject: Re: [PATCH v4 1/2] f2fs: avoid NULL checkpoint thread access in sysfs To: Wenjie Qi , jaegeuk@kernel.org References: <20260804014849.1942326-1-qiwenjie@xiaomi.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260804014849.1942326-1-qiwenjie@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/4/26 09:48, Wenjie Qi wrote: > checkpoint_merge can be enabled even when no checkpoint merge thread is > running. A read-only mount is one case: f2fs does not start > f2fs_issue_ckpt there, but ckpt_thread_ioprio is still writable through > sysfs. > > The ckpt_thread_ioprio store path updates the saved ioprio value and, > when checkpoint_merge is enabled, calls set_task_ioprio() for the > checkpoint thread. If cprc->f2fs_issue_ckpt is NULL, that dereferences a > NULL task pointer. > > Protect ckpt_thread_ioprio sysfs writes with s_umount as well, so the > checkpoint thread cannot disappear under the store path while updating > its ioprio. > > Fixes: e65920661708 ("f2fs: add ckpt_thread_ioprio sysfs node") > Cc: stable@kernel.org > Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Thanks,