linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Latypov <dlatypov@google.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Kees Cook <keescook@chromium.org>,
	David Gow <davidgow@google.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Vitor Massaru Iha <vitor@massaru.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-kernel@vger.kernel.org,
	KUnit Development <kunit-dev@googlegroups.com>,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2] lib: overflow: Convert to Kunit
Date: Wed, 23 Mar 2022 14:44:22 -0500	[thread overview]
Message-ID: <CAGS_qxrmfVppcaT0-q3=uh46NzS9tkTcEFtgE2_54rD_kE-3QA@mail.gmail.com> (raw)
In-Reply-To: <20220323151933.GA1363768@roeck-us.net>

On Wed, Mar 23, 2022 at 10:29 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Hi,
>
> On Wed, Feb 23, 2022 at 09:48:25PM -0800, Kees Cook wrote:
> > Convert overflow unit tests to KUnit, for better integration into the
> > kernel self test framework. Includes a rename of test_overflow.c to
> > overflow_kunit.c, and CONFIG_TEST_OVERFLOW to CONFIG_OVERFLOW_KUNIT_TEST.
> >
>
> This patch results in lots of test build failures
> due to large frame sizes.
>
> Building i386:allyesconfig ... failed
> --------------
> Error log:
> lib/overflow_kunit.c: In function 'overflow_size_helpers_test':
> lib/overflow_kunit.c:644:1: error: the frame size of 2480 bytes is larger than 2048 bytes

This is somewhat expected and should hopefully be fixed soon.


More detail:
Unless optimized away by the compiler, each KUNIT_EXPECT_* use will
add a struct to the stack.
I have a number of pending patches that will decrease that stack usage.
On UML (x86_64), they cut it down from 88 bytes => 32 bytes per
KUNIT_EXPECT_EQ/GT/etc.

Shuah sent a PR to Linus which contains these patches,
https://lore.kernel.org/all/d138a93a-997f-bfb6-6119-83aa2c00a49d@linuxfoundation.org/
Once those are in, hopefully all these warnings go away as we're not
over the 2048 limit by that much.

Daniel

      reply	other threads:[~2022-03-23 19:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  5:48 [PATCH v2] lib: overflow: Convert to Kunit Kees Cook
2022-02-24 21:32 ` Gustavo A. R. Silva
2022-02-25  7:57 ` David Gow
2022-02-27 17:33   ` Kees Cook
2022-03-23 15:19 ` Guenter Roeck
2022-03-23 19:44   ` Daniel Latypov [this message]

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='CAGS_qxrmfVppcaT0-q3=uh46NzS9tkTcEFtgE2_54rD_kE-3QA@mail.gmail.com' \
    --to=dlatypov@google.com \
    --cc=arnd@arndb.de \
    --cc=davidgow@google.com \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=linux@roeck-us.net \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).