From: Greg KH <gregkh@linuxfoundation.org>
To: ChenXiaoSong <chenxiaosong2@huawei.com>
Cc: viro@zeniv.linux.org.uk, stable@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com, yukuai3@huawei.com, yi.zhang@huawei.com,
zhangxiaoxu5@huawei.com
Subject: Re: [PATCH 4.19] VFS: Fix fuseblk memory leak caused by mount concurrency
Date: Wed, 13 Oct 2021 11:19:45 +0200 [thread overview]
Message-ID: <YWaksarpG4/PtMN9@kroah.com> (raw)
In-Reply-To: <20211013092117.639147-1-chenxiaosong2@huawei.com>
On Wed, Oct 13, 2021 at 05:21:17PM +0800, ChenXiaoSong wrote:
> If two processes mount same superblock, memory leak occurs:
>
> CPU0 | CPU1
> do_new_mount | do_new_mount
> fs_set_subtype | fs_set_subtype
> kstrdup |
> | kstrdup
> memrory leak |
>
> Fix this by adding a write lock while calling fs_set_subtype.
>
> Linus's tree already have refactoring patchset [1], one of them can fix this bug:
> c30da2e981a7 (fuse: convert to use the new mount API)
>
> Since we did not merge the refactoring patchset in this branch, I create this patch.
>
> [1] https://patchwork.kernel.org/project/linux-fsdevel/patch/20190903113640.7984-3-mszeredi@redhat.com/
>
> Fixes: 79c0b2df79eb (add filesystem subtype support)
> Cc: David Howells <dhowells@redhat.com>
> Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com>
> ---
> fs/namespace.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
Is this a v2 patch? If so, you need to list below the --- line what
changed.
thanks,
greg k-h
prev parent reply other threads:[~2021-10-13 9:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 9:21 [PATCH 4.19] VFS: Fix fuseblk memory leak caused by mount concurrency ChenXiaoSong
2021-10-13 9:19 ` Greg KH [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=YWaksarpG4/PtMN9@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=chenxiaosong2@huawei.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
--cc=zhangxiaoxu5@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.