]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
qed: validate and restrict untrusted VFs vlan promisc mode
authorManish Chopra <manishc@marvell.com>
Wed, 2 Mar 2022 10:52:22 +0000 (02:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:20 +0000 (13:57 +0200)
commit18bcfe9d20e2a7a72fe97ba4f62eb53badf78281
treebf3927641d70e4afc4c48a635bc9ddec38cc1a51
parent673cc1d97ec0764e4ddfa4808e1a522d5896b529
qed: validate and restrict untrusted VFs vlan promisc mode

commit cbcc44db2cf7b836896733acc0e5ea966136ed22 upstream.

Today when VFs are put in promiscuous mode, they can request PF
to configure device for them to receive all VLANs traffic regardless
of what vlan is configured by the PF (via ip link) and PF allows this
config request regardless of whether VF is trusted or not.

From security POV, when VLAN is configured for VF through PF (via ip link),
honour such config requests from VF only when they are configured to be
trusted, otherwise restrict such VFs vlan promisc mode config.

Cc: stable@vger.kernel.org
Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust")
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/qlogic/qed/qed_sriov.c
drivers/net/ethernet/qlogic/qed/qed_sriov.h