Issue
DPDK maps a device's IO into userspace, such as the device's control register, etc. What if the user is malicious, how does DPDK ensure the security of the device in this case? How does DPDK isolate the user from the device?
Solution
how does DPDK ensure the security of the device in this case? [Answer] There are none. DPDK like any library requires access to UIO instance of the device to configure and rx-tx or dequeue-enqueue packets from the device (NIC or crypto)
It has all the strengths and weaknesses as accessed by UIO_library from userspace. Refer
How does DPDK isolate the user from the device? [Answer] One of the features to achieve the same is to use SRIOV VF or Adaptive VF. where the PF (kernel signed driver) maintains the core device (NIC or Crypto). All requests for configuration is sent from userspace via VF through mailboxes assigned per VF. Either the hardware or PF driver validates each request and sends back success or failure for each request.
In the case of NIC TX, any malicious packet descriptor can be injected (it will pass the mailbox) path. But since it running on a specific queue (dedicated queue for VF) malicious packets will only bring down the VF device assigned to it.
The recommendation is to
- enable SRIOV in bios
- Use
iommu=pt
and in case of Intel useintel_iommu=on
. - Do not use driver noiommu.
- create VF or IAVF
- assign the VF device (NIC or Crypto) to the applciation.
Answered By - Vipin Varghese Answer Checked By - Willingham (WPSolving Volunteer)