lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 Aug 2021 21:36:52 +0800
From:   Chao Yu <chao@...nel.org>
To:     Yangtao Li <frank.li@...o.com>, jaegeuk@...nel.org
Cc:     linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] f2fs: fix potential memory leaks in
 create_discard_cmd_control

On 2021/8/11 21:18, Yangtao Li wrote:
> Release f2fs_issue_discard every time it is destroyed,
> otherwise it will cause memory leaks when remounting.

I didn't get the problem here, could you please explain a bit more about
details?

Thanks,

> 
> Signed-off-by: Yangtao Li <frank.li@...o.com>
> ---
>   fs/f2fs/segment.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index afe20c5c3c08..363779a4402d 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1741,6 +1741,7 @@ void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi)
>   
>   		dcc->f2fs_issue_discard = NULL;
>   		kthread_stop(discard_thread);
> +		put_task_struct(discard_thread);
>   	}
>   }
>   
> @@ -2168,6 +2169,7 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi)
>   		SM_I(sbi)->dcc_info = NULL;
>   		return err;
>   	}
> +	get_task_struct(dcc->f2fs_issue_discard);
>   
>   	return err;
>   }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ