[DPDK/other Bug 1665] __rte_trace_mem_get causing out of bounds write
bugzilla at dpdk.org
bugzilla at dpdk.org
Wed Feb 26 16:19:34 CET 2025
https://bugs.dpdk.org/show_bug.cgi?id=1665
Bug ID: 1665
Summary: __rte_trace_mem_get causing out of bounds write
Product: DPDK
Version: 24.11
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: other
Assignee: dev at dpdk.org
Reporter: oleksandrn at interfacemasters.com
Target Milestone: ---
When almost out of trace memory, __rte_trace_mem_get can write out of bounds.
It happens in my case if I have trace events of sizes that are not aligned to
__RTE_TRACE_EVENT_HEADER_SZ. like 27,33 etc.
I suspect that the issue is with the incorrect bounds check in
__rte_trace_mem_get.
> uint32_t offset = trace->offset;
> if (unlikely((offset + sz) >= trace->len)) { // assume condition is false,
> and offset is not aligned
> ...}
> offset = RTE_ALIGN_CEIL(offset, __RTE_TRACE_EVENT_HEADER_SZ); // after
> offset alignment offset + size might be bigger than trace->len
> void *mem = RTE_PTR_ADD(&trace->mem[0], offset); // returning memory chunk
> that is smaller than requested size
For example:
offset = 21, len = 32, size = 9 -> offset + size is smaller than len
align offset to __RTE_TRACE_EVENT_HEADER_SZ -> offset = 24
offset + size is bigger than len.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250226/63160710/attachment.htm>
More information about the dev
mailing list