[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202006151134.36BAA57@keescook>
Date: Mon, 15 Jun 2020 11:37:48 -0700
From: Kees Cook <keescook@...omium.org>
To: Vitor Massaru Iha <vitor@...saru.org>
Cc: kunit-dev@...glegroups.com, skhan@...uxfoundation.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
brendanhiggins@...gle.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux@...musvillemoes.dk
Subject: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of
check_*_overflow functions
On Mon, Jun 15, 2020 at 01:30:42PM -0300, Vitor Massaru Iha wrote:
> On Fri, 2020-06-12 at 15:36 -0700, Kees Cook wrote:
> > Why drop the __initconst?
>
> I removed __initconst because of these warnings below, as it is used
> for the kernel during the module initialization, and I do not use the
> module initialization in this tests. Does this have any side effects in
> these tests?
>
> WARNING: modpost: vmlinux.o(.text.unlikely+0x131b7): Section mismatch
> in reference from the function test_s8_overflow() to the variable
> .init.rodata:s8_tests
> The function test_s8_overflow() references
> the variable __initconst s8_tests.
> This is often because test_s8_overflow lacks a __initconst
> annotation or the annotation of s8_tests is wrong.
Ah, right. I assume there are build modes where the tests don't only
live in the __init section any more due to how Kunit does its runtime?
(Before all the tests ran from __init via module_init(), IIRC.)
> > So, yes! I like it. :) Most of my comments here have nothing to do with
> > specifically this patch (sorry)! But I'd love to see a v2.
> >
> > Thanks for doing this! I'm glad to see more TAP output. :)
>
> Thanks Kees, I'm learning a lot from you, and as I said privately with
> Brendan, I've never seen so much macro in a code. I learned a lot from
> it.
Heh, yes, for that I must beg forgiveness. ;) The macros are rather
wild, but it seemed the best way to avoid a ton of cut/paste code
duplication.
--
Kees Cook
Powered by blists - more mailing lists