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]
Message-ID: <CAGXu5j+k-VC+m4uFY1Sb8uX-ATCOQ15qVN=CpyX5nraQt+bE9A@mail.gmail.com>
Date:	Thu, 28 Jul 2016 12:35:14 -0700
From:	Kees Cook <keescook@...omium.org>
To:	Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...achi.com>
Cc:	Anton Vorontsov <anton@...msg.org>,
	Colin Cross <ccross@...roid.com>,
	Tony Luck <tony.luck@...el.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>,
	Mark Salyzyn <salyzyn@...roid.com>,
	Seiji Aguchi <seiji.aguchi.tr@...achi.com>
Subject: Re: [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of
 kfree() for freeing prz

On Sun, Jul 24, 2016 at 8:56 PM, Nobuhiro Iwamatsu
<nobuhiro.iwamatsu.kw@...achi.com> wrote:
> From: Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>
>
> persistent_ram_zone(=prz) structures are allocated by persistent_ram_new(),
> which includes vmap() or ioremap(). But they are currently freed by
> kfree(). This uses persistent_ram_free() for correct this asymmetry usage.
>
> Signed-off-by: Hiraku Toyooka <hiraku.toyooka.gu@...achi.com>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@...achi.com>
> Cc: Mark Salyzyn <salyzyn@...roid.com>
> Cc: Seiji Aguchi <seiji.aguchi.tr@...achi.com>

Oh, yes, oops. I may extract this patch and get it into v4.8, since
this is an explicit bug fix. Thanks!

-Kees

> ---
>  fs/pstore/ram.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index bd9812e..22416c0 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -567,11 +567,11 @@ fail_buf:
>         kfree(cxt->pstore.buf);
>  fail_clear:
>         cxt->pstore.bufsize = 0;
> -       kfree(cxt->mprz);
> +       persistent_ram_free(cxt->mprz);
>  fail_init_mprz:
> -       kfree(cxt->fprz);
> +       persistent_ram_free(cxt->fprz);
>  fail_init_fprz:
> -       kfree(cxt->cprz);
> +       persistent_ram_free(cxt->cprz);
>  fail_init_cprz:
>         ramoops_free_przs(cxt);
>  fail_out:
> --
> 2.8.1
>
>



-- 
Kees Cook
Chrome OS & Brillo Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ