]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: fix potential stack corruption from running past stat bitmask
authorAndrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru>
Fri, 26 Aug 2016 10:19:34 +0000 (11:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Aug 2016 04:40:44 +0000 (21:40 -0700)
commit320d40d7a218fe532053befd0ccbd920af71f93a
treef0409c417d22904e551a2240f711e6ffbb4848a8
parent7023ce7ca284b88395b56847edcec0ce983ab2a1
sfc: fix potential stack corruption from running past stat bitmask

On 32-bit systems, mask is only an array of 3 longs, not 4, so don't try
to write to mask[3].
Also include build-time checks in case the size of the bitmask changes.

Fixes: eceb81315dbf ("sfc: display vadaptor statistics for all interfaces")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10.c