]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3fda15e3a7e1f9964130b38e27bcb2f748ac797e
tree89e4196468b2f6c5267d8c725651371b6a8948cc
parentbfaac66987f5ea358db48e07d49608e20a63534f
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