Re: Re: [PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-24 Thread lyl2019
> -原始邮件- > 发件人: "Vivek Goyal" > 发送时间: 2021-03-24 01:10:03 (星期三) > 收件人: "Lv Yunlong" > 抄送: stefa...@redhat.com, mik...@szeredi.hu, > virtualizat...@lists.linux-foundation.org, linux-fsde...@vger.kernel.org, > linux-kernel@vger.kernel.org >

Re: [PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-23 Thread Vivek Goyal
On Mon, Mar 22, 2021 at 10:18:31PM -0700, Lv Yunlong wrote: > In virtio_fs_get_tree, fm is allocated by kzalloc() and > assigned to fsc->s_fs_info by fsc->s_fs_info=fm statement. > If the kzalloc() failed, it will goto err directly, so that > fsc->s_fs_info must be non-NULL and fm will be freed.

Re: [PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-23 Thread Connor Kuehl
On 3/23/21 12:18 AM, Lv Yunlong wrote: In virtio_fs_get_tree, fm is allocated by kzalloc() and assigned to fsc->s_fs_info by fsc->s_fs_info=fm statement. If the kzalloc() failed, it will goto err directly, so that Right, I follow this so far. fsc->s_fs_info must be non-NULL and fm will be

[PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-22 Thread Lv Yunlong
In virtio_fs_get_tree, fm is allocated by kzalloc() and assigned to fsc->s_fs_info by fsc->s_fs_info=fm statement. If the kzalloc() failed, it will goto err directly, so that fsc->s_fs_info must be non-NULL and fm will be freed. But later fm is freed again when virtio_fs_fill_super() fialed. I