[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171129053637.GA8125@js1304-P5Q-DELUXE>
Date: Wed, 29 Nov 2017 14:36:37 +0900
From: Joonsoo Kim <iamjoonsoo.kim@....com>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Namhyung Kim <namhyung@...nel.org>,
Wengang Wang <wen.gang.wang@...cle.com>
Subject: Re: [PATCH 02/18] vchecker: introduce the valid access checker
On Tue, Nov 28, 2017 at 11:41:08AM -0800, Andi Kleen wrote:
> js1304@...il.com writes:
>
> > From: Joonsoo Kim <iamjoonsoo.kim@....com>
>
> Looks useful. Essentially unlimited hardware break points, combined
> with slab.
Thanks!!!
>
> Didn't do a full review, but noticed some things below.
> > +
> > + buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
> > + if (!buf)
> > + return -ENOMEM;
> > +
> > + if (copy_from_user(buf, ubuf, cnt)) {
> > + kfree(buf);
> > + return -EFAULT;
> > + }
> > +
> > + if (isspace(buf[0]))
> > + remove = true;
>
> and that may be uninitialized.
I will add 'cnt == 0' check above.
> and the space changes the operation? That's a strange syntax.
Intention is to clear the all the previous configuration when user
input is '\n'. Will fix it by checking '\n' directly.
>
> > + buf[cnt - 1] = '\0';
>
> That's an underflow of one byte if cnt is 0.
Will add 'cnt == 0' check above.
String parsing part in this patchset will not work properly when the
last input character is not '\n'. I will fix it on the next spin.
Thanks.
Powered by blists - more mailing lists