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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b77146eb-f2cf-f2eb-b0c2-561879c23475@huawei.com>
Date: Wed, 19 Nov 2025 09:52:19 +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 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.

>>  	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