Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

raid6test: fix stack overflow

Testing on x86_64 with NDISKS=255 yields:

do_IRQ: modprobe near stack overflow (cur:ffff88007d19c000,sp:ffff88007d19c128)

...and eventually

general protection fault: 0000 [#1]

Moving the scribble buffers off the stack allows the test to complete
successfully.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+1 -2
+1 -2
crypto/async_tx/raid6test.c
··· 28 28 #define NDISKS 16 /* Including P and Q */ 29 29 30 30 static struct page *dataptrs[NDISKS]; 31 + static addr_conv_t addr_conv[NDISKS]; 31 32 static struct page *data[NDISKS+3]; 32 33 static struct page *spare; 33 34 static struct page *recovi; ··· 70 69 static void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, struct page **ptrs) 71 70 { 72 71 struct async_submit_ctl submit; 73 - addr_conv_t addr_conv[disks]; 74 72 struct completion cmp; 75 73 struct dma_async_tx_descriptor *tx = NULL; 76 74 enum sum_check_flags result = ~0; ··· 156 156 157 157 static int test(int disks, int *tests) 158 158 { 159 - addr_conv_t addr_conv[disks]; 160 159 struct dma_async_tx_descriptor *tx; 161 160 struct async_submit_ctl submit; 162 161 struct completion cmp;