In the Linux kernel, the following vulnerability has been resolved:
net: enetc: deny offload of tc-based TSN features on VF interfaces
TSN features on the ENETC (taprio, cbs, gate, police) are configured through a mix of command BD ring messages and port registers: enetcportrd(), enetcportwr().
Port registers are a region of the ENETC memory map which are only accessible from the PCIe Physical Function. They are not accessible from the Virtual Functions.
Moreover, attempting to access these registers crashes the kernel:
$ echo 1 > /sys/bus/pci/devices/0000\:00\:00.0/sriovnumvfs pci 0000:00:01.0: [1957:ef00] type 00 class 0x020001 fslenetcvf 0000:00:01.0: Adding to iommu group 15 fslenetcvf 0000:00:01.0: enabling device (0000 -> 0002) fslenetcvf 0000:00:01.0 eno0vf0: renamed from eth0 $ tc qdisc replace dev eno0vf0 root taprio numtc 8 map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 \ sched-entry S 0x7f 900000 sched-entry S 0x80 100000 flags 0x2 Unable to handle kernel paging request at virtual address ffff800009551a08 Internal error: Oops: 96000007 [#1] PREEMPT SMP pc : enetcsetuptctaprio+0x170/0x47c lr : enetcsetuptctaprio+0x16c/0x47c Call trace: enetcsetuptctaprio+0x170/0x47c enetcsetuptc+0x38/0x2dc tapriochange+0x43c/0x970 taprioinit+0x188/0x1e0 qdisccreate+0x114/0x470 tcmodifyqdisc+0x1fc/0x6c0 rtnetlinkrcvmsg+0x12c/0x390
Split enetcsetuptc() into separate functions for the PF and for the VF drivers. Also remove enetc_qos.o from being included into enetc-vf.ko, since it serves absolutely no purpose there.