linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Chengming Zhou <zhouchengming@bytedance.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	syzbot+2fdf66e68f5f882c1074@syzkaller.appspotmail.com
Subject: Re: [PATCH] fs/kernfs: Fix lockdep warning in kernfs_active()
Date: Wed, 9 Nov 2022 05:46:37 -1000	[thread overview]
Message-ID: <Y2vLXWvZ9uwaVICx@slm.duckdns.org> (raw)
In-Reply-To: <20221109120415.55759-1-zhouchengming@bytedance.com>

On Wed, Nov 09, 2022 at 08:04:15PM +0800, Chengming Zhou wrote:
> syzbot found a lockdep warning in kernfs_find_and_get_node_by_id(),
> bisected to the commit c25491747b21 ("kernfs: Add KERNFS_REMOVING flags"),
> which didn't hold kernfs_rwsem before call kernfs_active(kn).
> 
> Since kernfs_find_and_get_node_by_id() doesn't have to get active count
> of kn, only need to get a stable refcount of kn, so it should be enough
> to just check kn has been KERNFS_ACTIVATED.
> 
> Reported-by: syzbot+2fdf66e68f5f882c1074@syzkaller.appspotmail.com
> Fixes: c25491747b21 ("kernfs: Add KERNFS_REMOVING flags")
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2022-11-09 15:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 16:11 [syzbot] WARNING in kernfs_find_and_get_node_by_id syzbot
2022-11-07 12:07 ` Chengming Zhou
2022-11-09 12:04 ` [PATCH] fs/kernfs: Fix lockdep warning in kernfs_active() Chengming Zhou
2022-11-09 15:46   ` Tejun Heo [this message]
2022-11-10 18:00   ` Greg KH
2022-11-10 18:11     ` Tejun Heo
2022-11-10 18:20       ` Greg KH
2022-11-10 18:28         ` Tejun Heo
2022-11-23 18:30   ` Greg KH
2022-11-23 18:35     ` Tejun Heo

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=Y2vLXWvZ9uwaVICx@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+2fdf66e68f5f882c1074@syzkaller.appspotmail.com \
    --cc=zhouchengming@bytedance.com \
    /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;
as well as URLs for NNTP newsgroup(s).