Bug 796
Summary: | Lack of error checking in rte_pktmbuf_mtod could lead to a seg fault | ||
---|---|---|---|
Product: | DPDK | Reporter: | Juan Camilo Vega (camilo.vega) |
Component: | ethdev | Assignee: | dev |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | dmitry.kozliuk, olivier.matz |
Priority: | Normal | ||
Version: | 21.05 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All |
Description
Juan Camilo Vega
2021-08-26 16:39:55 CEST
Thank you for sharing your experience, Juan. DPDK ethdev layer or user code cannot reliably detect or mitigate a NIC/firmware/PMD glitches that produce incorrect mbufs (consider buf_addr containing a random value). rte_pktmbuf_mtod() is a data path function and as such it avoids any checks that are not absolutely necessary and assumes a valid input, in order to maximize performance. Running a faulty hardware with uio_pci_generic is extremely dangerous to the system due to unrestricted DMA ability. However, if the error happens due to software reasons, e.g. a PMD bug or an firmware blocking an unusable mbuf, a specific PMD can be able to detect a failure and, for example, not to fill and return an invalid mbuf. So please tell which NIC and PMD are you using. You can also try updating DPDK to 20.11 (which should be compatible with yours). Agree with Dmitry. If the PMD builds an invalid mbuf, it has to be fixed in the PMD. Adding a check in rte_pktmbuf_mtod() would slow down everyone for a case that should not happen. |