]> nv-tegra.nvidia Code Review - linux-2.6.git/commit
iop-adma: Corrected array overflow in RAID6 Xscale(R) test.
authorDon Morris <don.morris@hp.com>
Thu, 15 Mar 2012 18:07:30 +0000 (11:07 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 18 Apr 2012 13:43:10 +0000 (19:13 +0530)
commitdb10f2177800d6b428f1969c7b9073d545f51049
tree5419a25a1d9837628226fbe87dc5029e0a5e4415
parente2cb1727fbde88b66d0f7042ab1d9cb7d3c62531
iop-adma: Corrected array overflow in RAID6 Xscale(R) test.

Bug: cppcheck reported overflow in array assignment (for loop walks
0 to IOP_ADMA_NUM_SRC_TEST+2, array size is IOP_ADMA_NUM_SRC_TEST).

Reported as: https://bugzilla.kernel.org/show_bug.cgi?id=42677

Test code pq_src array was grown by two elements to correspond with actual
usage (IOP_ADMA_NUM_SRC_TEST+2), stack consumption was kept constant by
modifying the pq_dest two element array which is only used when pq_src
is referenced up to IOP_ADMA_NUM_SRC_TEST elements into the address
of the new last two elements of the pq_src array. This is presumed to
be the original intent but would be reliant on compilers always having
pq_dest contiguous with the final element of pq_src.

Note: This is a re-send of a request for review from two weeks ago.
Looking for review (or shootdown), adding LKML to list for a wider
audience. Thanks.

Updated per review comments of Sergei Shtylyov <sshtylyov@mvista.com>

Signed-off-by: Don Morris <don.morris@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/iop-adma.c