[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181130022637.GA105443@google.com>
Date: Thu, 29 Nov 2018 18:26:37 -0800
From: Joel Fernandes <joel@...lfernandes.org>
To: Kees Cook <keescook@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>
Subject: Re: [PATCH 2/8] pstore: Do not use crash buffer for decompression
On Thu, Nov 29, 2018 at 02:06:39PM -0800, Kees Cook wrote:
> On Tue, Nov 13, 2018 at 11:56 PM Kees Cook <keescook@...omium.org> wrote:
> > On Fri, Nov 2, 2018 at 1:24 PM, Joel Fernandes <joel@...lfernandes.org> wrote:
> > > On Thu, Nov 01, 2018 at 04:51:54PM -0700, Kees Cook wrote:
> > >> + workspace = kmalloc(unzipped_len + record->ecc_notice_size,
> > >
> > > Should tihs be unzipped_len + record->ecc_notice_size + 1. The extra byte
> > > being for the NULL character of the ecc notice?
> > >
> > > This occurred to me when I saw the + 1 in ram.c. It could be better to just
> > > abstract the size as a macro.
> >
> > Ooh, yes, good catch. I'll get this fixed.
>
> I spent more time looking at this, and it seems that only the initial
> creation of this string needs the +1, since all other operations are
> byte-based not NUL-terminated string based. It's a big odd, and I
> might try to clean it up differently, but as it stands, this is okay.
> (See inode.c which doesn't include the trailing NUL byte.)
Ok. Yes it does seem a bit inconsistent but I agree its not an issue for this
particular patch. Sorry to waste your time, thanks!
- Joel
Powered by blists - more mailing lists