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, 6 Oct 2021 21:02:16 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Mike Rapoport <rppt@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>, Linux-MM <linux-mm@...ck.org>,
        Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH v4 1/4] bootconfig: init: Fix memblock leak in
 xbc_make_cmdline()

On Thu, 16 Sep 2021 15:23:12 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:

> Free unused memblock in a error case to fix memblock leak
> in xbc_make_cmdline().
> 
> Fixes: 51887d03aca1 ("bootconfig: init: Allow admin to use bootconfig for kernel command line")
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
>  init/main.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/init/main.c b/init/main.c
> index 3f7216934441..0b054fff8e92 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -382,6 +382,7 @@ static char * __init xbc_make_cmdline(const char *key)
>  	ret = xbc_snprint_cmdline(new_cmdline, len + 1, root);
>  	if (ret < 0 || ret > len) {
>  		pr_err("Failed to print extra kernel cmdline.\n");
> +		memblock_free_ptr(new_cmdline, len + 1);
>  		return NULL;
>  	}
>  

Hmm, looking at my patch queue, I noticed that this did not get
applied. I'm thinking I may have been confused with the other memory
freeing that was put into the xbc_destroy(), thinking this was part of
that. But now that I look at this patch in the context of the code, it
looks like this patch is required, as "new_cmdline" never gets exposed
on this error.

Masami, I just want to confirm, that this patch is still relevant, right?

Thanks!

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ