From: Kees Cook <keescook@chromium.org>
To: Vitor Massaru Iha <vitor@massaru.org>
Cc: linux@rasmusvillemoes.dk, brendanhiggins@google.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
kunit-dev@googlegroups.com
Subject: Re: [Linux-kernel-mentees] [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions
Date: Mon, 15 Jun 2020 11:37:48 -0700 [thread overview]
Message-ID: <202006151134.36BAA57@keescook> (raw)
In-Reply-To: <0c9d09065dca0b71466600e68b64142402a98d24.camel@massaru.org>
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
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Kees Cook <keescook@chromium.org>
To: Vitor Massaru Iha <vitor@massaru.org>
Cc: kunit-dev@googlegroups.com, skhan@linuxfoundation.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
brendanhiggins@google.com,
linux-kernel-mentees@lists.linuxfoundation.org,
linux@rasmusvillemoes.dk
Subject: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions
Date: Mon, 15 Jun 2020 11:37:48 -0700 [thread overview]
Message-ID: <202006151134.36BAA57@keescook> (raw)
In-Reply-To: <0c9d09065dca0b71466600e68b64142402a98d24.camel@massaru.org>
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
next prev parent reply other threads:[~2020-06-15 18:37 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-11 21:55 [Linux-kernel-mentees] [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions Vitor Massaru Iha
2020-06-11 21:55 ` Vitor Massaru Iha
2020-06-12 19:06 ` [Linux-kernel-mentees] " Brendan Higgins via Linux-kernel-mentees
2020-06-12 19:06 ` Brendan Higgins
2020-06-12 22:36 ` [Linux-kernel-mentees] " Kees Cook
2020-06-12 22:36 ` Kees Cook
2020-06-13 6:51 ` [Linux-kernel-mentees] " David Gow via Linux-kernel-mentees
2020-06-13 6:51 ` David Gow
2020-06-14 17:48 ` [Linux-kernel-mentees] common KUnit Kconfig and file naming (was: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions) Kees Cook
2020-06-14 17:48 ` Kees Cook
2020-06-16 7:25 ` [Linux-kernel-mentees] " David Gow via Linux-kernel-mentees
2020-06-16 7:25 ` David Gow
2020-06-16 9:40 ` [Linux-kernel-mentees] " Alan Maguire
2020-06-16 9:40 ` Alan Maguire
2020-06-17 4:20 ` [Linux-kernel-mentees] " David Gow via Linux-kernel-mentees
2020-06-17 4:20 ` David Gow
2020-06-18 20:27 ` [Linux-kernel-mentees] " Brendan Higgins via Linux-kernel-mentees
2020-06-18 20:27 ` Brendan Higgins
2020-06-19 3:42 ` [Linux-kernel-mentees] " Kees Cook
2020-06-19 3:42 ` Kees Cook
2020-06-19 6:39 ` [Linux-kernel-mentees] " David Gow via Linux-kernel-mentees
2020-06-19 6:39 ` David Gow
2020-06-19 20:12 ` [Linux-kernel-mentees] " Brendan Higgins via Linux-kernel-mentees
2020-06-19 20:12 ` Brendan Higgins
2020-06-15 16:30 ` [Linux-kernel-mentees] [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions Vitor Massaru Iha
2020-06-15 16:30 ` Vitor Massaru Iha
2020-06-15 18:37 ` Kees Cook [this message]
2020-06-15 18:37 ` Kees Cook
2020-06-13 6:56 ` [Linux-kernel-mentees] " David Gow via Linux-kernel-mentees
2020-06-13 6:56 ` David Gow
2020-06-15 16:33 ` [Linux-kernel-mentees] " Vitor Massaru Iha
2020-06-15 16:33 ` Vitor Massaru Iha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202006151134.36BAA57@keescook \
--to=keescook@chromium.org \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=vitor@massaru.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.