]> git.baikalelectronics.ru Git - kernel.git/commit
i40evf: don't overflow buffer
authorMitch Williams <mitch.a.williams@intel.com>
Mon, 16 May 2016 17:26:36 +0000 (10:26 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 27 Jun 2016 22:31:50 +0000 (15:31 -0700)
commitf0ad055baa2a0c58a02d82ebde733d06141473b9
tree9d50068925a25f58e97cd340a74d691a8b8adde4
parent14a8927784d1f1b39f626b9095faa8f70fc4696a
i40evf: don't overflow buffer

If the user adds an obscene amount of MAC addresses, the driver will run
into the situation where it has too many address requests to fit into a
single PF message. The driver checks for this case, and calculates the
maximum number of messages that it can send. Then it completely ignores
this count and overflows the buffer.

Fix this by checking the address count and bailing out of the loop at
the appropriate time.

Change-ID: If8dcbb04602c75941dc0cd8309065e1de9ca791c
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c