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] [day] [month] [year] [list]
Message-ID: <c081f098-27dd-739c-4468-5c0197937cc4@huawei.com>
Date: Thu, 20 Nov 2025 11:45:45 +0800
From: Wu Guanghao <wuguanghao3@...wei.com>
To: "Darrick J. Wong" <djwong@...nel.org>
CC: <tytso@....edu>, <adilger.kernel@...ger.ca>, <linux-ext4@...r.kernel.org>,
	<yangyun50@...wei.com>
Subject: Re: [PATCH 2/2] resize: fix memory leak when exiting normally



在 2025/11/19 14:26, Darrick J. Wong 写道:
> On Wed, Nov 19, 2025 at 09:52:19AM +0800, Wu Guanghao wrote:
>>
>>
>> 在 2025/11/19 2:29, Darrick J. Wong 写道:
>>> On Tue, Nov 18, 2025 at 09:26:01PM +0800, Wu Guanghao wrote:
>>>> The main() function only releases fs when it exits through the errout or
>>>> success_exit labels. When completes normally, it does not release fs.
>>>>
>>>> Signed-off-by: Wu Guanghao <wuguanghao3@...wei.com>
>>>> ---
>>>>  resize/main.c | 2 ++
>>>>  1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/resize/main.c b/resize/main.c
>>>> index 08a4bbaf..71711229 100644
>>>> --- a/resize/main.c
>>>> +++ b/resize/main.c
>>>> @@ -702,6 +702,8 @@ int main (int argc, char ** argv)
>>>>  	}
>>>>  	if (fd > 0)
>>>>  		close(fd);
>>>> +
>>>> +	(void) ext2fs_close_free(&fs);
>>>
>>> You might want to capture and print an error if one is returned, because
>>> ext2fs_close_free will also flush the new metadata to disk.
>>>
>>> --D
>>>
>> This is not an error, but a normal process exit. If there is an error,
>> it will follow the errout tag.
> 
> I can see that, but I'm talking about capturing errors returned by
> the new ext2fs_close_free call itself.
> 
> --D
> 

OK, I misunderstood. I will add a check in the next version.

>>>>  	remove_error_table(&et_ext2_error_table);
>>>>  	return 0;
>>>>  errout:
>>>> -- 
>>>> 2.27.0
>>>>
>>>>
>>>
>>>
>>> .
> 
> .

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ