Open guyharris opened 11 years ago
@guyharris Morris Traversal instead of recursion? https://www.educative.io/edpresso/what-is-morris-traversal
If I understand this, the "attack" is on the command line, or as input to the libpcap compiler. (The oss-fuzz description was completely useless)
pcap_compile() -> bpf_optimize() -> opt_init() -> count_blocks()
... count_blocks()
...which recursively walks the control-flow graph for the program.
Note that it's a DAG, not a tree. I'd have to look some more at the Morris algorithm to see to what extent that's an issue. Nodes are marked to make sure they're not visited more than once (if you do a depth-first traversal, you may traverse end nodes more than once, for example; there may be multiple ways to either match a packet or fail to match a packet, so there may be multiple paths to the two end nodes).
Converted from SourceForge issue 709338, submitted by nobody
when the tree is depth enough, some recursion functions will "eat up" the stack.
for example:
tcpdump is coredump.