summaryrefslogtreecommitdiff
path: root/contrib/apps/httpserver
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2026-05-26 02:09:15 +0000
committerTom Rini <[email protected]>2026-06-11 12:01:15 -0600
commit84e250c0a85a615620a461e0710bb970801fb276 (patch)
tree54012182e08cfb96f7f95303159ec84699940b13 /contrib/apps/httpserver
parentca774b94d66332b6bd033369227ac487ad07d5e8 (diff)
fdt_support: validate dma-ranges length in fdt_get_dma_range
fdt_get_dma_range() fetches the dma-ranges property with fdt_getprop() and checks only that the length is non-zero before reading one full entry from it. The entry size depends on na, pna and ns cells returned by count_cells, which come from the parent buses in the devicetree. A dma-ranges property shorter than (na + pna + ns) * sizeof(u32) bytes causes fdt_read_number() and fdt_translate_dma_address() to read past the end of the property within the FDT blob, an out-of-bounds read of attacker-influenced data when the OS devicetree is not signature verified. Reject the property when its length is smaller than one full entry and return -EINVAL, matching the existing failure paths in this function. Use debug() rather than printf() for the rejection text so that production builds do not pay any .text or .rodata growth for the new diagnostic. Signed-off-by: Aristo Chen <[email protected]>
Diffstat (limited to 'contrib/apps/httpserver')
0 files changed, 0 insertions, 0 deletions