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:   Mon, 24 May 2021 17:40:59 +0300
From:   Благодаренко Артём 
        <artem.blagodarenko@...il.com>
To:     Wu Guanghao <wuguanghao3@...wei.com>
Cc:     linux-ext4@...r.kernel.org, liuzhiqiang26@...wei.com,
        linfeilong@...wei.com
Subject: Re: [PATCH 03/12] zap_sector: fix memory leak

Hello Wu,

Thank you for the fixes.

It looks like free and return operators should be placed in {} block.

{
	free(buf);
 	return;
}

Now function returns any time block is read successfully.

Also, this patch can not be applied cleanly to the master HEAD because of wrong offsets. Please rebase.

Best regards,
Artem Blagodarenko.

> On 24 May 2021, at 14:20, Wu Guanghao <wuguanghao3@...wei.com> wrote:
> 
> In zap_sector(), need free buf before return,
> otherwise it will cause memory leak.
> 
> Signed-off-by: Wu Guanghao <wuguanghao3@...wei.com>
> Signed-off-by: Zhiqiang Liu <liuzhiqiang26@...wei.com>
> Reviewed-by: Wu Bo <wubo40@...wei.com>
> ---
> misc/mke2fs.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index afbcf486..94f81da9 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -586,6 +586,7 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect)
> 			magic = (unsigned int *) (buf + BSD_LABEL_OFFSET);
> 			if ((*magic == BSD_DISKMAGIC) ||
> 				(*magic == BSD_MAGICDISK))
> +				free(buf);
> 				return;
> 		}
> 	}
> -- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ