From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Max Filippov <jcmvbkbc@gmail.com>, Marco Elver <elver@google.com>,
Sasha Levin <sashal@kernel.org>,
kasan-dev@googlegroups.com
Subject: [PATCH AUTOSEL 5.10 03/17] kcsan: test: don't put the expect array on the stack
Date: Mon, 16 Jan 2023 09:04:34 -0500 [thread overview]
Message-ID: <20230116140448.116034-3-sashal@kernel.org> (raw)
In-Reply-To: <20230116140448.116034-1-sashal@kernel.org>
From: Max Filippov <jcmvbkbc@gmail.com>
[ Upstream commit 5b24ac2dfd3eb3e36f794af3aa7f2828b19035bd ]
Size of the 'expect' array in the __report_matches is 1536 bytes, which
is exactly the default frame size warning limit of the xtensa
architecture.
As a result allmodconfig xtensa kernel builds with the gcc that does not
support the compiler plugins (which otherwise would push the said
warning limit to 2K) fail with the following message:
kernel/kcsan/kcsan_test.c:257:1: error: the frame size of 1680 bytes
is larger than 1536 bytes
Fix it by dynamically allocating the 'expect' array.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Marco Elver <elver@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kcsan/kcsan-test.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/kcsan/kcsan-test.c b/kernel/kcsan/kcsan-test.c
index ebe7fd245104..8a8ccaf4f38f 100644
--- a/kernel/kcsan/kcsan-test.c
+++ b/kernel/kcsan/kcsan-test.c
@@ -149,7 +149,7 @@ static bool report_matches(const struct expect_report *r)
const bool is_assert = (r->access[0].type | r->access[1].type) & KCSAN_ACCESS_ASSERT;
bool ret = false;
unsigned long flags;
- typeof(observed.lines) expect;
+ typeof(*observed.lines) *expect;
const char *end;
char *cur;
int i;
@@ -158,6 +158,10 @@ static bool report_matches(const struct expect_report *r)
if (!report_available())
return false;
+ expect = kmalloc(sizeof(observed.lines), GFP_KERNEL);
+ if (WARN_ON(!expect))
+ return false;
+
/* Generate expected report contents. */
/* Title */
@@ -241,6 +245,7 @@ static bool report_matches(const struct expect_report *r)
strstr(observed.lines[2], expect[1])));
out:
spin_unlock_irqrestore(&observed.lock, flags);
+ kfree(expect);
return ret;
}
--
2.35.1
next prev parent reply other threads:[~2023-01-16 14:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 14:04 [PATCH AUTOSEL 5.10 01/17] scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 02/17] cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist Sasha Levin
2023-01-16 14:04 ` Sasha Levin [this message]
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 04/17] ASoC: fsl_micfil: Correct the number of steps on SX controls Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 05/17] drm: Add orientation quirk for Lenovo ideapad D330-10IGL Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 06/17] s390/debug: add _ASM_S390_ prefix to header guard Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 07/17] arm64/mm: Define dummy pud_user_exec() when using 2-level page-table Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 08/17] cpufreq: armada-37xx: stop using 0 as NULL pointer Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 09/17] ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 10/17] ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 11/17] spi: spidev: fix a race condition when accessing spidev->spi Sasha Levin
2023-01-16 14:40 ` Mark Brown
2023-01-23 0:59 ` Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 12/17] spi: spidev: remove debug messages that access spidev->spi without locking Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 13/17] KVM: s390: interrupt: use READ_ONCE() before cmpxchg() Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 14/17] scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 15/17] platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 16/17] platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK Sasha Levin
2023-01-16 14:04 ` [PATCH AUTOSEL 5.10 17/17] lockref: stop doing cpu_relax in the cmpxchg loop Sasha Levin
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=20230116140448.116034-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=elver@google.com \
--cc=jcmvbkbc@gmail.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox