hv_netvsc: Restrict configurations on isolated guests
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Mon, 1 Feb 2021 14:48:14 +0000 (15:48 +0100)
committerWei Liu <wei.liu@kernel.org>
Thu, 11 Feb 2021 08:47:05 +0000 (08:47 +0000)
commit96854bbda24febe2cc9231e1f6ffbd3059dc57fc
treea5488cbdedb4e83910e8f2e09954535efc80e9aa
parent7ef4b2f0d9adb73eb66e1f87f22953169c3dc7f8
hv_netvsc: Restrict configurations on isolated guests

Restrict the NVSP protocol version(s) that will be negotiated with the
host to be NVSP_PROTOCOL_VERSION_61 or greater if the guest is running
isolated.  Moreover, do not advertise the SR-IOV capability and ignore
NVSP_MSG_4_TYPE_SEND_VF_ASSOCIATION messages in isolated guests, which
are not supposed to support SR-IOV.  This reduces the footprint of the
code that will be exercised by Confidential VMs and hence the exposure
to bugs and vulnerabilities.

Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210201144814.2701-5-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/net/hyperv/netvsc.c