linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies
@ 2021-09-15  4:40 Guenter Roeck
  2021-09-15  9:02 ` Christian Borntraeger
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2021-09-15  4:40 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Vasily Gorbik, Christian Borntraeger, linux-s390, linux-kernel,
	Guenter Roeck

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


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

* Re: [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies
  2021-09-15  4:40 [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies Guenter Roeck
@ 2021-09-15  9:02 ` Christian Borntraeger
  2021-09-15 14:08   ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2021-09-15  9:02 UTC (permalink / raw)
  To: Guenter Roeck, Heiko Carstens; +Cc: Vasily Gorbik, linux-s390, linux-kernel



On 15.09.21 06:40, Guenter Roeck wrote:
> 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.
> 

Thanks for the patch. I think Heiko (on vacation) has a patch to
get rid  of this config alltogether, which is probably the better
solution.


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

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

* Re: [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies
  2021-09-15  9:02 ` Christian Borntraeger
@ 2021-09-15 14:08   ` Guenter Roeck
  2021-09-15 15:13     ` Vasily Gorbik
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2021-09-15 14:08 UTC (permalink / raw)
  To: Christian Borntraeger, Heiko Carstens
  Cc: Vasily Gorbik, linux-s390, linux-kernel

On 9/15/21 2:02 AM, Christian Borntraeger wrote:
> 
> 
> On 15.09.21 06:40, Guenter Roeck wrote:
>> 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.
>>
> 
> Thanks for the patch. I think Heiko (on vacation) has a patch to
> get rid  of this config alltogether, which is probably the better
> solution.
> 

I did consider that, but concluded that this would be something a maintainer
should do and went with what I thought was the least invasive method.
I did check the various mailing lists for other patches, but I did not
find anything there. Sorry if I missed it.

Guenter

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

* Re: [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies
  2021-09-15 14:08   ` Guenter Roeck
@ 2021-09-15 15:13     ` Vasily Gorbik
  0 siblings, 0 replies; 4+ messages in thread
From: Vasily Gorbik @ 2021-09-15 15:13 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Christian Borntraeger, Heiko Carstens, linux-s390, linux-kernel

On Wed, Sep 15, 2021 at 07:08:21AM -0700, Guenter Roeck wrote:
> > Thanks for the patch. I think Heiko (on vacation) has a patch to
> > get rid  of this config alltogether, which is probably the better
> > solution.
> > 
> 
> I did consider that, but concluded that this would be something a maintainer
> should do and went with what I thought was the least invasive method.
> I did check the various mailing lists for other patches, but I did not
> find anything there. Sorry if I missed it.

Sorry, we could have been more transparent with our patch queue. The
patch is from Monday and with our regular ci/qa queue delay it is now on
fixes branch:

https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/commit/?h=fixes&id=f5711f9df9242446feccf2bdb6fdc06a72ca1010

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

end of thread, other threads:[~2021-09-15 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  4:40 [PATCH] s390: Add WARN_DYNAMIC_STACK dependencies Guenter Roeck
2021-09-15  9:02 ` Christian Borntraeger
2021-09-15 14:08   ` Guenter Roeck
2021-09-15 15:13     ` Vasily Gorbik

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