From patchwork Mon Jan 25 12:45:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 370643 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp5259046jam; Tue, 26 Jan 2021 11:09:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6Mzl2l9ZXcTNOAdH3XQrLOatLeGtEXRkrgW1zug97Xqza53nFnBMPqdJkrkhUbPf9Xn+I X-Received: by 2002:a17:907:a06f:: with SMTP id ia15mr4456036ejc.328.1611688197770; Tue, 26 Jan 2021 11:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611688197; cv=none; d=google.com; s=arc-20160816; b=YmiK0sZeXzKQycHi8LixPr+u9uP9GP2azAH3W7birPmTLC03wO0rLtbmBkwk7J3GnP gb+eXxLRH4j+idOxNEZD0FOSvEEITjOHt3f6+NS8nK4T94hzvQ8YBeZ/U4qbd2I0M9zK vxlhc5/FMSz/+9xfdoSGleF8X+Alo0WxmmuAu/K17UKU4NlntJa70eQaKVUsfCyg1ypm MTtWaNapABowNjcZI4qRMuwZw57bsf+CJY3QV02DOUCMSuEynTwEEqiJovrsqwXOV/R5 VHw3lq3yZDGk2Cr+t/N8OfXwjGjQn2jQJgeDuCQt30XeM//1TrHQsh0fr1J2xWMcK8Sy yJ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QRnXNvtecA+5xzBEEFZLq8/Axo7Lxlcsn9ETTJ7F54Y=; b=dXYShEf454iM3CUWNvAVQMY91UVoQngEm14totcykOWPLWqrU+4crQ3Mdh+vWxaEm5 tCJ5FRdLsLKuBYjdbHT6xN+uud6xxvOxbXZInI47ybWfcDk3/n+HIlVHadzT4qCnytUu JooD8X8b3nHJ9wSKkkM2HEOGdK2Fh8kwg73jM6Vg0dFXl9pippGGfXOH2lnOxqMLBRdd EqKkmgra3F2BLieLbXZz2DaJ+UlKsxvzyZQhlKqpF/+TkNLa2aUMF/I/jvESkFe0omeg awS6lFSRxyE4jDO2GWQFkJSE8wJYmZTUjFuEkcexaX1pdr04U9+G2p+de6ZnDJMCRmNf /8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ELK6YOHu; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si7153710ejt.469.2021.01.26.11.09.57; Tue, 26 Jan 2021 11:09:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ELK6YOHu; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730670AbhAZF6R (ORCPT + 6 others); Tue, 26 Jan 2021 00:58:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:39526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728015AbhAYMqX (ORCPT ); Mon, 25 Jan 2021 07:46:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 433DE229EF; Mon, 25 Jan 2021 12:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611578740; bh=56tdACcGGHFZFmeBO08RKmJkzc4zo0dNrypPmbndIvE=; h=From:To:Cc:Subject:Date:From; b=ELK6YOHuJmo+Zj67jVaKWqSYNUu9XLe/QuKcN06FLPeeDWAVm/KtFxMcH3iXXgwh4 9cJVZp2/iBnjGto6GUvby/wMrYKlHbvazXwQEchiOcJ6WrRyVwiqzT1PAUlR+12F3c cAKsjT5XPq4omzuUCtXLDy6mt98opSLzdPDlNfKuTMeBS9BNQmrnOPHlbXzBw/PxeQ TQzQuWcFlAEFnlXDsVTD95oljHl1253XO0zMWfgnrK4+DpLKMdvw13/ctqyKxSIAk7 gxWnboyIFHrkbCkmSqJTLNj22GgmrAFA8nuRkiiuUaC9mtgKDOFiknfpO8xHnDRE6u 23ElbZ+qGaVig== From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Kees Cook , Brendan Higgins , Shuah Khan , Geert Uytterhoeven , Alan Maguire , Dmitry Torokhov , Mika Westerberg , Vitor Massaru Iha , linux-hardening@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com Subject: [RFC 0/3] kunit vs structleak Date: Mon, 25 Jan 2021 13:45:25 +0100 Message-Id: <20210125124533.101339-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Arnd Bergmann 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 Cc: Brendan Higgins Cc: Shuah Khan Cc: Geert Uytterhoeven Cc: Alan Maguire Cc: Dmitry Torokhov Cc: Mika Westerberg Cc: Vitor Massaru Iha 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