linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "岩松信洋 / IWAMATSU,NOBUHIRO" <nobuhiro.iwamatsu.kw@hitachi.com>
Cc: "Anton Vorontsov" <anton@enomsg.org>,
	"Colin Cross" <ccross@android.com>,
	"Tony Luck" <tony.luck@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Mark Salyzyn" <salyzyn@android.com>,
	"阿口誠司 / AGUCHI,SEIJI" <seiji.aguchi.tr@hitachi.com>,
	"ltc-kernel@rdgml.intra.hitachi.co.jp"
	<ltc-kernel@rdgml.intra.hitachi.co.jp>,
	"森谷真寿美 / MORITANI,MASUMI" <masumi.moritani.ju@hitachi.com>
Subject: Re: [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz
Date: Wed, 3 Aug 2016 12:04:47 -0700	[thread overview]
Message-ID: <CAGXu5jL+sdv2Ndu8nBXo-DuzBOFAX1cZO25_PQsBUTiFQ9kRKg@mail.gmail.com> (raw)
In-Reply-To: <F89ECF87BC754A49BB74E794F6A0EC2FEFDD8E@GSjpTKYDCembx31.service.hitachi.net>

On Thu, Jul 28, 2016 at 10:58 PM, 岩松信洋 / IWAMATSU,NOBUHIRO
<nobuhiro.iwamatsu.kw@hitachi.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: keescook@google.com [mailto:keescook@google.com] On Behalf Of Kees
>> Cook
>> Sent: Friday, July 29, 2016 4:35 AM
>> To: 岩松信洋 / IWAMATSU,NOBUHIRO
>> Cc: Anton Vorontsov; Colin Cross; Tony Luck; LKML; Hiraku Toyooka; Mark
>> Salyzyn; 阿口誠司 / AGUCHI,SEIJI
>> 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@hitachi.com> wrote:
>> > From: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.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@hitachi.com>
>> > Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.kw@hitachi.com>
>> > Cc: Mark Salyzyn <salyzyn@android.com>
>> > Cc: Seiji Aguchi <seiji.aguchi.tr@hitachi.com>
>>
>> Oh, yes, oops. I may extract this patch and get it into v4.8, since this
>> is an explicit bug fix. Thanks!
>>
>> -Kees
>
> Thanks. Please pickup this commit as bug fix.

Applied, this should get picked up soon.

> And if you have a time, please review other patches in this patch series.

For sure; I'm busy with the 4.8 merge window being open right now, but
after that I'll get them reviewed.

Thanks!

-Kees

>
> Best regards,
>   Nobuhiro
>
>>
>> > ---
>> >  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



-- 
Kees Cook
Brillo & Chrome OS Security

  reply	other threads:[~2016-08-03 19:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25  3:56 [PATCH v2 0/5] pstore: ramoops: support multiple pmsg instances Nobuhiro Iwamatsu
2016-07-25  3:56 ` [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz Nobuhiro Iwamatsu
2016-07-28 19:35   ` Kees Cook
2016-07-29  5:58     ` 岩松信洋 / IWAMATSU,NOBUHIRO
2016-08-03 19:04       ` Kees Cook [this message]
2016-07-25  3:56 ` [PATCH v2 2/5] ramoops: introduce generic init/free functions for prz Nobuhiro Iwamatsu
2016-09-08 21:22   ` Kees Cook
2016-10-05  4:06     ` 岩松信洋 / IWAMATSU,NOBUHIRO
2016-07-25  3:56 ` [PATCH v2 3/5] pstore: support multiple pmsg instances Nobuhiro Iwamatsu
2016-09-08 21:33   ` Kees Cook
2016-10-05  4:09     ` 岩松信洋 / IWAMATSU,NOBUHIRO
2016-07-25  3:56 ` [PATCH v2 4/5] ramoops: " Nobuhiro Iwamatsu
2016-09-08 21:53   ` Kees Cook
2016-10-05  4:13     ` 岩松信洋 / IWAMATSU,NOBUHIRO
2016-07-25  3:56 ` [PATCH v2 5/5] selftests/pstore: add testcases for " Nobuhiro Iwamatsu
2016-09-08 21:55   ` Kees Cook
2016-10-05  4:14     ` 岩松信洋 / IWAMATSU,NOBUHIRO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGXu5jL+sdv2Ndu8nBXo-DuzBOFAX1cZO25_PQsBUTiFQ9kRKg@mail.gmail.com \
    --to=keescook@chromium.org \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltc-kernel@rdgml.intra.hitachi.co.jp \
    --cc=masumi.moritani.ju@hitachi.com \
    --cc=nobuhiro.iwamatsu.kw@hitachi.com \
    --cc=salyzyn@android.com \
    --cc=seiji.aguchi.tr@hitachi.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).