lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201910081110.C2C582408F@keescook>
Date:   Tue, 8 Oct 2019 11:15:14 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Brendan Higgins <brendanhiggins@...gle.com>
Cc:     David Gow <davidgow@...gle.com>, shuah@...nel.org,
        akpm@...ux-foundation.org, linux-kselftest@...r.kernel.org,
        kunit-dev@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lib/list-test: add a test for the 'list' doubly linked
 list

On Tue, Oct 08, 2019 at 10:48:37AM -0700, Brendan Higgins wrote:
> On Mon, Oct 07, 2019 at 02:36:33PM -0700, David Gow wrote:
> > This change adds a KUnit test for the kernel doubly linked list
> > implementation in include/linux/list.h
> > 
> > Note that, at present, it only tests the list_ types (not the
> > singly-linked hlist_), and does not yet test all of the
> > list_for_each_entry* macros (and some related things like
> > list_prepare_entry).
> > 
> > This change depends on KUnit, so should be merged via the 'test' branch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/log/?h=test
> > 
> > Signed-off-by: David Gow <davidgow@...gle.com>
> > ---
> >  lib/Kconfig.debug |  12 +
> >  lib/Makefile      |   3 +
> >  lib/list-test.c   | 711 ++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 726 insertions(+)
> >  create mode 100644 lib/list-test.c
> 
> Also, I think it might be good to make a MAINTAINERs entry for this
> test.

Another thought, though maybe this is already covered and I missed the
"best practices" notes on naming conventions.

As the "one-off" tests are already named "foo_test.c" it seems like
KUnit tests should be named distinctly. Should this be lib/kunit-list.c,
lib/list-kunit.c, or something else?

For internal naming of structs and tests, should things be
named "kunit_foo"? Examples here would be kunit_list_struct and
kunit_list_test_...

When testing other stuff, should only exposed interfaces be tested?
Many things have their API exposed via registration of a static structure
of function pointers to static functions. What's the proposed best way
to get at that? Should the KUnit tests is IN the .c file that declares
all the static functions?

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ