]> git.baikalelectronics.ru Git - kernel.git/commit
ice: Prevent probing virtual functions
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Wed, 28 Jul 2021 19:39:10 +0000 (12:39 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 9 Aug 2021 16:59:23 +0000 (09:59 -0700)
commitd9bd6af1dd8e72a580992656cc5829d55ed86401
treefe2e2380ded1bfe025f4323f1f6660b2946a93e4
parent6677f5e7194becbf980dbe1c510ca8298f84a465
ice: Prevent probing virtual functions

The userspace utility "driverctl" can be used to change/override the
system's default driver choices. This is useful in some situations
(buggy driver, old driver missing a device ID, trying a workaround,
etc.) where the user needs to load a different driver.

However, this is also prone to user error, where a driver is mapped
to a device it's not designed to drive. For example, if the ice driver
is mapped to driver iavf devices, the ice driver crashes.

Add a check to return an error if the ice driver is being used to
probe a virtual function.

Fixes: e4d53476c16a ("ice: Add basic driver framework for Intel(R) E800 Series")
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c