qede: Fix out-of-bound fastpath memory access
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Sat, 29 Oct 2016 14:04:35 +0000 (17:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Oct 2016 00:51:46 +0000 (20:51 -0400)
commit087892d29b75c025086d99b29d385a3dac0169fc
tree89e4196468b2f6c5267d8c725651371b6a8948cc
parent3034783472f5353f71af44ed52ad9ee65f9f6d17
qede: Fix out-of-bound fastpath memory access

Driver allocates a shadow array for transmitted SKBs with X entries;
That means valid indices are {0,...,X - 1}. [X == 8191]
Problem is the driver also uses X as a mask for a
producer/consumer in order to choose the right entry in the
array which allows access to entry X which is out of bounds.

To fix this, simply allocate X + 1 entries in the shadow array.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_main.c