public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Guangshuo Li <lgs201920130244@gmail.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: chao@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] f2fs: fix uninitialized kobject put in f2fs_init_sysfs()
Date: Mon, 13 Apr 2026 19:38:16 +0800	[thread overview]
Message-ID: <ac3b7022-a81f-432f-b841-aa2afea414e5@kernel.org> (raw)
In-Reply-To: <20260410124726.2035729-1-lgs201920130244@gmail.com>

On 4/10/2026 8:47 PM, Guangshuo Li wrote:
> In f2fs_init_sysfs(), all failure paths after kset_register() jump to
> put_kobject, which unconditionally releases both f2fs_tune and
> f2fs_feat.
> 
> If kobject_init_and_add(&f2fs_feat, ...) fails, f2fs_tune has not been
> initialized yet, so calling kobject_put(&f2fs_tune) is invalid.
> 
> Fix this by splitting the unwind path so each error path only releases
> objects that were successfully initialized.
> 
> Fixes: a907f3a68ee26ba4 ("f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

  reply	other threads:[~2026-04-13 11:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 12:47 [PATCH] f2fs: fix uninitialized kobject put in f2fs_init_sysfs() Guangshuo Li
2026-04-13 11:38 ` Chao Yu [this message]
2026-04-15 16:50 ` [f2fs-dev] " patchwork-bot+f2fs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac3b7022-a81f-432f-b841-aa2afea414e5@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox