From: "Song Feng" <songfengcn@163.com> To: "Chao Yu" <yuchao0@huawei.com> Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re:[f2fs-dev] [PATCH] f2fs: fix use-after-free issue Date: Thu, 23 Jul 2020 23:26:01 +0800 (CST) [thread overview] Message-ID: <666af139.9663.1737c480519.Coremail.songfengcn@163.com> (raw) In-Reply-To: <20200723102806.9662-1-yuchao0@huawei.com> At 2020-07-23 17:28:06, "Chao Yu" <yuchao0@huawei.com> wrote: >From: Li Guifu <bluce.liguifu@huawei.com> > >During umount, f2fs_put_super() unregisters procfs entries after >f2fs_destroy_segment_manager(), it may cause use-after-free >issue when umount races with procfs accessing, fix it by relcating typo issue: relcating -> relocating? >f2fs_unregister_sysfs(). > >[Chao Yu: change commit title/message a bit] > >Signed-off-by: Li Guifu <bluce.liguifu@huawei.com> >Reviewed-by: Chao Yu <yuchao0@huawei.com> >Signed-off-by: Chao Yu <yuchao0@huawei.com> >--- > fs/f2fs/super.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c >index 80cb7cd358f8..bf8bd64c8380 100644 >--- a/fs/f2fs/super.c >+++ b/fs/f2fs/super.c >@@ -1175,6 +1175,9 @@ static void f2fs_put_super(struct super_block *sb) > int i; > bool dropped; > >+ /* unregister procfs/sysfs entries to avoid race case */ >+ f2fs_unregister_sysfs(sbi); >+ > f2fs_quota_off_umount(sb); > > /* prevent remaining shrinker jobs */ >@@ -1240,8 +1243,6 @@ static void f2fs_put_super(struct super_block *sb) > > kvfree(sbi->ckpt); > >- f2fs_unregister_sysfs(sbi); >- > sb->s_fs_info = NULL; > if (sbi->s_chksum_driver) > crypto_free_shash(sbi->s_chksum_driver); >-- >2.26.2 > > > >_______________________________________________ >Linux-f2fs-devel mailing list >Linux-f2fs-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel please check typo issue for comment: relcating->relocating?
WARNING: multiple messages have this Message-ID (diff)
From: "Song Feng" <songfengcn@163.com> To: "Chao Yu" <yuchao0@huawei.com> Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: fix use-after-free issue Date: Thu, 23 Jul 2020 23:26:01 +0800 (CST) [thread overview] Message-ID: <666af139.9663.1737c480519.Coremail.songfengcn@163.com> (raw) In-Reply-To: <20200723102806.9662-1-yuchao0@huawei.com> At 2020-07-23 17:28:06, "Chao Yu" <yuchao0@huawei.com> wrote: >From: Li Guifu <bluce.liguifu@huawei.com> > >During umount, f2fs_put_super() unregisters procfs entries after >f2fs_destroy_segment_manager(), it may cause use-after-free >issue when umount races with procfs accessing, fix it by relcating typo issue: relcating -> relocating? >f2fs_unregister_sysfs(). > >[Chao Yu: change commit title/message a bit] > >Signed-off-by: Li Guifu <bluce.liguifu@huawei.com> >Reviewed-by: Chao Yu <yuchao0@huawei.com> >Signed-off-by: Chao Yu <yuchao0@huawei.com> >--- > fs/f2fs/super.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c >index 80cb7cd358f8..bf8bd64c8380 100644 >--- a/fs/f2fs/super.c >+++ b/fs/f2fs/super.c >@@ -1175,6 +1175,9 @@ static void f2fs_put_super(struct super_block *sb) > int i; > bool dropped; > >+ /* unregister procfs/sysfs entries to avoid race case */ >+ f2fs_unregister_sysfs(sbi); >+ > f2fs_quota_off_umount(sb); > > /* prevent remaining shrinker jobs */ >@@ -1240,8 +1243,6 @@ static void f2fs_put_super(struct super_block *sb) > > kvfree(sbi->ckpt); > >- f2fs_unregister_sysfs(sbi); >- > sb->s_fs_info = NULL; > if (sbi->s_chksum_driver) > crypto_free_shash(sbi->s_chksum_driver); >-- >2.26.2 > > > >_______________________________________________ >Linux-f2fs-devel mailing list >Linux-f2fs-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel please check typo issue for comment: relcating->relocating? _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-07-23 15:42 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-23 10:28 [PATCH] f2fs: fix use-after-free issue Chao Yu 2020-07-23 10:28 ` [f2fs-dev] " Chao Yu 2020-07-23 15:26 ` Song Feng [this message] 2020-07-23 15:26 ` Song Feng 2020-07-24 1:22 ` Chao Yu 2020-07-24 1:22 ` Chao Yu
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=666af139.9663.1737c480519.Coremail.songfengcn@163.com \ --to=songfengcn@163.com \ --cc=jaegeuk@kernel.org \ --cc=linux-f2fs-devel@lists.sourceforge.net \ --cc=linux-kernel@vger.kernel.org \ --cc=yuchao0@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: linkBe 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.