Commit ae8921a
authored
Fix: Addressed out-of-bands read from a buffer in udp_rx_dequeue function (#1320)
Guard udp_rx_dequeue against truncated mbufs by comparing
rte_pktmbuf_pkt_len(pkt) with sizeof(struct mt_udp_hdr) and bailing with
EBADMSG if the headers aren’t fully present.
Recompute the payload pointer via rte_pktmbuf_mtod_offset and
validate the UDP payload length against both the UDP header value and
the actual bytes available in the mbuf before any rte_memcpy, prevent
the out-of-bounds read.
Logg richer diagnostics (using signed widths) and set errno when
malformed packets are detected so callers receive a clear failure
instead of silent drops.1 parent 2f2a792 commit ae8921a
1 file changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
916 | 927 | | |
917 | | - | |
918 | | - | |
919 | | - | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
920 | 941 | | |
921 | 942 | | |
922 | 943 | | |
| |||
0 commit comments