]> www.infradead.org Git - users/jedix/linux-maple.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)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:30:26 +0000 (19:30 -0500)
commitd6a5b17d3770e50cfb245e0d952b842269c5ce92
treeb126dcf36c4c7409d9afd0a69f6a6afcb73fee87
parentd9a56eee63ce8becb316e284c01875e6c2140722
i40evf: don't overflow buffer

Orabug: 24568124

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>
(cherry picked from commit 0e8d95f8965dc2e6f22e5b321b73de7b0396dc4a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c