Validate that the VF has sent us a valid VSI index before actually using
that index. Without this code, a malicious or buggy VF driver could
panic the host by sending an invalid index into the VSI array.
Change-ID: I66a177687a0dcc281ec83e714d3813d70d18c8b4
Reported-by: Nick Nunley <nicholas.d.nunley@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
{
struct i40e_pf *pf = vf->pf;
+ if (vsi_id > pf->num_alloc_vsi)
+ return false;
return pf->vsi[vsi_id]->vf_id == vf->vf_id;
}