All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Dongliang Mu <mudongliangabcd@gmail.com>
To: xiang@kernel.org, Chao Yu <chao@kernel.org>,
	linux-erofs@lists.ozlabs.org
Cc: syzbot+045796dbe294d53147e6@syzkaller.appspotmail.com
Subject: How to fix the bug in "WARNING: kobject bug in erofs_unregister_sysfs"?
Date: Thu, 10 Mar 2022 18:15:20 +0800	[thread overview]
Message-ID: <CAD-N9QXNx=p3-QoWzk6pCznF32CZy8kM3vvo8mamfZZ9CpUKdw@mail.gmail.com> (raw)

Hi kernel developers,

I am writing to kindly ask for some suggestions on fixing "WARNING:
kobject bug in erofs_unregister_sysfs".

The underlying issue is in the following,

erofs_fc_get_tree
-> get_tree_bdev
  -> fill_super
    -> erofs_fc_fill_super

When erofs_register_sysfs fails in the calling kobject_init_and_add,
it just returned an error code and the parent function will call
deactivate_locked_super to do clean up.

In the following stack trace, it finally calls erofs_unregister_sysfs
without knowing the execution status of erofs_register_sysfs, which
leads to the kobject bug.

 erofs_unregister_sysfs+0x46/0x60 fs/erofs/sysfs.c:225
 erofs_put_super+0x37/0xb0 fs/erofs/super.c:771
 generic_shutdown_super+0x14c/0x400 fs/super.c:465
 kill_block_super+0x97/0xf0 fs/super.c:1397
 erofs_kill_sb+0x60/0x190 fs/erofs/super.c:752
 deactivate_locked_super+0x94/0x160 fs/super.c:335
 get_tree_bdev+0x573/0x760 fs/super.c:1297

I am not sure how to fix this bug. Any suggestion is appreciated.

--
My best regards to you.

     No System Is Safe!
     Dongliang Mu

             reply	other threads:[~2022-03-10 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 10:15 Dongliang Mu [this message]
2022-03-10 12:39 ` How to fix the bug in "WARNING: kobject bug in erofs_unregister_sysfs"? Gao Xiang
2022-03-10 14:04   ` Dongliang Mu
2022-03-11  4:08     ` Dongliang Mu
2022-03-11  4:56       ` Gao Xiang
2022-03-11  7:49         ` Dongliang Mu

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='CAD-N9QXNx=p3-QoWzk6pCznF32CZy8kM3vvo8mamfZZ9CpUKdw@mail.gmail.com' \
    --to=mudongliangabcd@gmail.com \
    --cc=chao@kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=syzbot+045796dbe294d53147e6@syzkaller.appspotmail.com \
    --cc=xiang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.