mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>, Andi Kleen <ak@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Kozlov Sergey <serjk@netup.ru>, <kbuild-all@01.org>,
	<linux-media@vger.kernel.org>, Abylay Ospan <aospan@netup.ru>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>
Subject: [PATCH] Disable -Wframe-larger-than warnings with KASAN=y
Date: Fri, 16 Oct 2015 19:02:10 +0300	[thread overview]
Message-ID: <1445011330-22698-1-git-send-email-aryabinin@virtuozzo.com> (raw)
In-Reply-To: <20151005110923.GA16831@wfg-t540p.sh.intel.com>

When the kernel compiled with KASAN=y, GCC adds redzones
for each variable on stack. This enlarges function's stack
frame and causes:
	'warning: the frame size of X bytes is larger than Y bytes'

The worst case I've seen for now is following:
 ../net/wireless/nl80211.c: In function ‘nl80211_send_wiphy’:
 ../net/wireless/nl80211.c:1731:1: warning: the frame size of 5448 bytes is larger than 2048 bytes [-Wframe-larger-than=]
  }
   ^
That kind of warning becomes useless with KASAN=y. It doesn't necessarily
indicate that there is some problem in the code, thus we should turn it off.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index ab76b99..1d1521c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -197,6 +197,7 @@ config ENABLE_MUST_CHECK
 config FRAME_WARN
 	int "Warn for stack frames larger than (needs gcc 4.4)"
 	range 0 8192
+	default 0 if KASAN
 	default 1024 if !64BIT
 	default 2048 if 64BIT
 	help
-- 
2.4.9


  parent reply	other threads:[~2015-10-16 16:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAK3bHNWkeakZP0cEi+U=GjmPa0jN9qWC4seyS6+ih8inzvmbXQ@mail.gmail.com>
2015-10-05 11:09 ` [kbuild-all] drivers/media/dvb-frontends/cxd2841er.c:2393:1: warning: the frame size of 2992 bytes is larger than 2048 bytes Fengguang Wu
2015-10-05 12:10   ` Andrey Ryabinin
2015-10-16 16:02   ` Andrey Ryabinin [this message]
2015-10-16 16:05     ` [PATCH] Disable -Wframe-larger-than warnings with KASAN=y Abylay Ospan
2015-10-16 16:47     ` Andi Kleen
2015-10-16 17:19       ` Andrey Ryabinin

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=1445011330-22698-1-git-send-email-aryabinin@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=aospan@netup.ru \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=mingo@kernel.org \
    --cc=serjk@netup.ru \
    /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

all inboxes | Powered by JetHome®