linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] kunit vs structleak
@ 2021-01-25 12:45 Arnd Bergmann
  2021-01-25 12:45 ` [RFC 1/3] bitfield: build kunit tests without structleak plugin Arnd Bergmann
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Arnd Bergmann @ 2021-01-25 12:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Arnd Bergmann, Kees Cook, Brendan Higgins, Shuah Khan,
	Geert Uytterhoeven, Alan Maguire, Dmitry Torokhov,
	Mika Westerberg, Vitor Massaru Iha, linux-hardening,
	linux-kselftest, kunit-dev

From: Arnd Bergmann <arnd@arndb.de>

I ran into a couple of problems with kunit tests taking too much stack
space, sometimes dangerously so. These the the three instances that
cause an increase over the warning limit of some architectures:

lib/bitfield_kunit.c:93:1: error: the frame size of 7440 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
drivers/base/test/property-entry-test.c:481:1: error: the frame size of 2640 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
drivers/thunderbolt/test.c:1529:1: error: the frame size of 1176 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Ideally there should be a way to rewrite the kunit infrastructure
that avoids the explosion of stack data when the structleak plugin
is used.

A rather drastic measure would be to use Kconfig logic to make
the two options mutually exclusive. This would clearly work, but
is probably not needed.

As a simpler workaround, this disables the plugin for the three
files in which the excessive stack usage was observed.

      Arnd

Arnd Bergmann (3):
  bitfield: build kunit tests without structleak plugin
  drivers/base: build kunit tests without structleak plugin
  thunderbolt: build kunit tests without structleak plugin

 drivers/base/test/Makefile   | 1 +
 drivers/thunderbolt/Makefile | 1 +
 lib/Makefile                 | 1 +
 3 files changed, 3 insertions(+)

Cc: Kees Cook <keescook@chromium.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Vitor Massaru Iha <vitor@massaru.org>
Cc: linux-hardening@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Cc: linux-kernel@vger.kernel.org
-- 
2.29.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-29 21:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 12:45 [RFC 0/3] kunit vs structleak Arnd Bergmann
2021-01-25 12:45 ` [RFC 1/3] bitfield: build kunit tests without structleak plugin Arnd Bergmann
2021-01-25 12:45 ` [RFC 2/3] drivers/base: " Arnd Bergmann
2021-01-25 12:45 ` [RFC 3/3] thunderbolt: " Arnd Bergmann
2021-01-27 12:53   ` Mika Westerberg
2021-01-27 20:15 ` [RFC 0/3] kunit vs structleak Kees Cook
2021-01-29 21:29   ` Brendan Higgins

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).