lkml.org 
[lkml]   [2022]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 14/16] kasan: Remove ksize()-related tests
On Sat, Sep 24, 2022 at 10:15:18AM +0200, Dmitry Vyukov wrote:
> On Fri, 23 Sept 2022 at 22:28, Kees Cook <keescook@chromium.org> wrote:
> >
> > In preparation for no longer unpoisoning in ksize(), remove the behavioral
> > self-tests for ksize().
> >
> > [...]
> > -/* Check that ksize() makes the whole object accessible. */
> > -static void ksize_unpoisons_memory(struct kunit *test)
> > -{
> > - char *ptr;
> > - size_t size = 123, real_size;
> > -
> > - ptr = kmalloc(size, GFP_KERNEL);
> > - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr);
> > - real_size = ksize(ptr);
> > -
> > - OPTIMIZER_HIDE_VAR(ptr);
> > -
> > - /* This access shouldn't trigger a KASAN report. */
> > - ptr[size] = 'x';
>
> I would rather keep the tests and update to the new behavior. We had
> bugs in ksize, we need test coverage.
> I assume ptr[size] access must now produce an error even after ksize.

Good point on all these! I'll respin.

--
Kees Cook

\
 
 \ /
  Last update: 2022-09-26 02:39    [W:0.084 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site