]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: fix possible overrun of VFPF multicast addresses array
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 3 Mar 2017 16:08:30 +0000 (17:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Mar 2017 21:47:15 +0000 (13:47 -0800)
commit224fc1a601810b455a8800e4274df77a0734462f
tree229ab2058dae31cd20c3c8e27906f1ea583a360e
parent046a91f6a5b47389eeeb471d6d1a13c1ac191190
bnx2x: fix possible overrun of VFPF multicast addresses array

It is too late to check for the limit of the number of VF multicast
addresses after they have already been copied to the req->multicast[]
array, possibly overflowing it.

Do the check before copying.

Also fix the error path to not skip unlocking vf2pf_mutex.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c