]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Dec 2017 09:32:29 +0000 (10:32 +0100)
commitfc4281753409d6afd4851e864c35a3a74a62dd37
treec136739746df64199dc1fcdbadabbfb0ec32e654
parentb263f04c208fd2b9c3845bce2576bdd17047f69b
bnx2x: fix possible overrun of VFPF multicast addresses array

[ Upstream commit 22118d861cec5da6ed525aaf12a3de9bfeffc58f ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c