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.
Unified · Split
| @@ -159,7 +159,7 @@ static bool __report_matches(const struct expect_report *r) · 158 unmodified lines | ||
| 159 | 159 | const bool is_assert = (r->access[0].type | r->access[1].type) & KCSAN_ACCESS_ASSERT; |
| 160 | 160 | bool ret = false; |
| 161 | 161 | unsigned long flags; |
| 162 | − typeof(observed.lines) expect; | |
| 162 | + typeof(*observed.lines) *expect; | |
| 163 | 163 | const char *end; |
| 164 | 164 | char *cur; |
| 165 | 165 | int i; |
| @@ -168,6 +168,10 @@ static bool __report_matches(const struct expect_report *r) · 2 unmodified lines | ||
| 168 | 168 | if (!report_available()) |
| 169 | 169 | return false; |
| 170 | 170 | |
| 171 | + expect = kmalloc(sizeof(observed.lines), GFP_KERNEL); | |
| 172 | + if (WARN_ON(!expect)) | |
| 173 | + return false; | |
| 174 | + | |
| 171 | 175 | /* Generate expected report contents. */ |
| 172 | 176 | |
| 173 | 177 | /* Title */ |
| @@ -253,6 +257,7 @@ static bool __report_matches(const struct expect_report *r) · 79 unmodified lines | ||
| 253 | 257 | strstr(observed.lines[2], expect[1]))); |
| 254 | 258 | out: |
| 255 | 259 | spin_unlock_irqrestore(&observed.lock, flags); |
| 260 | + kfree(expect); | |
| 256 | 261 | return ret; |
| 257 | 262 | } |
| 258 | 263 | |