From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbcG2F62 (ORCPT ); Fri, 29 Jul 2016 01:58:28 -0400 Received: from mail4.hitachi.co.jp ([133.145.228.5]:60629 "EHLO mail4.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbcG2F60 (ORCPT ); Fri, 29 Jul 2016 01:58:26 -0400 From: =?utf-8?B?5bKp5p2+5L+h5rSLIC8gSVdBTUFUU1XvvIxOT0JVSElSTw==?= To: Kees Cook CC: Anton Vorontsov , Colin Cross , "Tony Luck" , LKML , Mark Salyzyn , =?utf-8?B?6Zi/5Y+j6Kqg5Y+4IC8gQUdVQ0hJ77yMU0VJSkk=?= , "ltc-kernel@rdgml.intra.hitachi.co.jp" , =?utf-8?B?5qOu6LC355yf5a+/576OIC8gTU9SSVRBTknvvIxNQVNVTUk=?= , "ltc-kernel@rdgml.intra.hitachi.co.jp" Subject: RE: [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz Thread-Topic: [PATCH v2 1/5] ramoops: use persistent_ram_free() instead of kfree() for freeing prz Thread-Index: AQHR5iim7fL5WbMBeUKCfGx1W7BlaqAtqyEAgAE9fRA= Date: Fri, 29 Jul 2016 05:58:22 +0000 Deferred-Delivery: Fri, 29 Jul 2016 05:58:00 +0000 Message-ID: References: <1469419019-4820-1-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com> <1469419019-4820-2-git-send-email-nobuhiro.iwamatsu.kw@hitachi.com> In-Reply-To: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.232.28.229] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u6T5wZWE004159 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 > wrote: > > From: Hiraku Toyooka > > > > 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 > > Signed-off-by: Nobuhiro Iwamatsu > > Cc: Mark Salyzyn > > Cc: Seiji Aguchi > > 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. And if you have a time, please review other patches in this patch series. 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