All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies
Date: Tue, 14 Sep 2021 21:40:10 -0700	[thread overview]
Message-ID: <20210915044010.640499-1-linux@roeck-us.net> (raw)

s390:allmodconfig fails to build with the following errors.

arch/s390/kernel/syscall.c: In function '__do_syscall':
arch/s390/kernel/syscall.c:168:1: error:
	'__do_syscall' uses dynamic stack allocation

lib/test_kasan.c: In function 'kasan_alloca_oob_right':
lib/test_kasan.c:782:1: error:
	'kasan_alloca_oob_right' uses dynamic stack allocation

lib/test_kasan.c: In function 'kasan_alloca_oob_left':
lib/test_kasan.c:767:1: error:
	'kasan_alloca_oob_left' uses dynamic stack allocation

The first error is seen if RANDOMIZE_KSTACK_OFFSET_DEFAULT,
WARN_DYNAMIC_STACK, and WERROR are enabled. The other problems
are seen if KASAN_KUNIT_TEST, WARN_DYNAMIC_STACK, and WERROR
are enabled.

It does not make sense to abort a build in that situation.
If either RANDOMIZE_KSTACK_OFFSET_DEFAULT or KASAN_KUNIT_TEST
is enabled, dynamic stack allocation is on purpose and should
not fail the build. Add dependencies to reflect that situation.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/s390/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 2bd90c51efd3..776b730e2d15 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -688,6 +688,7 @@ config STACK_GUARD
 config WARN_DYNAMIC_STACK
 	def_bool n
 	prompt "Emit compiler warnings for function with dynamic stack usage"
+	depends on !WERROR || (!RANDOMIZE_KSTACK_OFFSET_DEFAULT && !KASAN_KUNIT_TEST)
 	help
 	  This option enables the compiler option -mwarn-dynamicstack. If the
 	  compiler supports this options generates warnings for functions
-- 
2.33.0


             reply	other threads:[~2021-09-15  4:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  4:40 Guenter Roeck [this message]
2021-09-15  9:02 ` [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies Christian Borntraeger
2021-09-15 14:08   ` Guenter Roeck
2021-09-15 15:13     ` Vasily Gorbik

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=20210915044010.640499-1-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=borntraeger@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.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.