All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	Yang Yingliang <yangyingliang@huawei.com>
Subject: Re: [f2fs-dev] [PATCH] f2fs: fix possible memory leak in f2fs_init_sysfs()
Date: Thu, 27 Oct 2022 20:26:22 -0700	[thread overview]
Message-ID: <Y1tL3pG4FAb9IA8o@google.com> (raw)
In-Reply-To: <4a58e927-bbcb-6e19-ca50-f2a4445dad3a@kernel.org>

On 10/28, Chao Yu wrote:
> Jaegeuk,
> 
> There is a generic fix [1], let's drop this one...

Ok, thanks.

> 
> https://lore.kernel.org/lkml/20221025071549.1280528-1-yangyingliang@huawei.com/T/
> 
> On 2022/10/20 16:45, Chao Yu wrote:
> > On 2022/10/18 15:32, Yang Yingliang wrote:
> > > Inject fault while probing module, kset_register() may fail,
> > > if it fails, but the refcount of kobject is not decreased to
> > > 0, the name allocated in kobject_set_name() is leaked. Fix
> > > this by calling kset_put(), so that name can be freed in
> > > callback function kobject_cleanup().
> > > 
> > > unreferenced object 0xffff888101b7cc80 (size 8):
> > >    comm "modprobe", pid 252, jiffies 4294691378 (age 31.760s)
> > >    hex dump (first 8 bytes):
> > >      66 32 66 73 00 88 ff ff                          f2fs....
> > >    backtrace:
> > >      [<000000001db5b408>] __kmalloc_node_track_caller+0x44/0x1b0
> > >      [<000000002783a073>] kstrdup+0x3a/0x70
> > >      [<00000000ead2b281>] kstrdup_const+0x63/0x80
> > >      [<000000003e5cf8f7>] kvasprintf_const+0x149/0x180
> > >      [<00000000c4d949ff>] kobject_set_name_vargs+0x56/0x150
> > >      [<0000000044611660>] kobject_set_name+0xab/0xe0
> > > 
> > > Fixes: bf9e697ecd42 ("f2fs: expose features to sysfs entry")
> > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> > 
> > Reviewed-by: Chao Yu <chao@kernel.org>
> > 
> > Thanks,
> > 
> > 
> > _______________________________________________
> > Linux-f2fs-devel mailing list
> > Linux-f2fs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2022-10-28  3:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  7:32 [f2fs-dev] [PATCH] f2fs: fix possible memory leak in f2fs_init_sysfs() Yang Yingliang via Linux-f2fs-devel
2022-10-20  8:45 ` Chao Yu
2022-10-28  0:58   ` Chao Yu
2022-10-28  3:26     ` Jaegeuk Kim [this message]

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=Y1tL3pG4FAb9IA8o@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yangyingliang@huawei.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 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.