Created attachment 1298073 [details] Triggered by "./cflow $POC" Description of problem: There is a heap-use-after-free in reference() funtion of cflow. Version-Release number of selected component (if applicable): <= latest version How reproducible: ./cflow $POC Steps to Reproduce: The information is as follows: $./cflow POC2 Segmentation fault The ASAN debugging information is as follows: $./cflow POC2 ================================================================= ==26111==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e00000c4d0 at pc 0x0000004fd9fa bp 0x7ffd71c71750 sp 0x7ffd71c71748 READ of size 8 at 0x60e00000c4d0 thread T0 #0 0x4fd9f9 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4fd9f9) #1 0x50267f (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x50267f) #2 0x4fc013 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4fc013) #3 0x4fbc2f (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4fbc2f) #4 0x4fb5b5 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4fb5b5) #5 0x4f2085 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4f2085) #6 0x7fabd69d3abf (/lib/x86_64-linux-gnu/libc.so.6+0x20abf) #7 0x438938 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x438938) 0x60e00000c4d0 is located 144 bytes inside of 152-byte region [0x60e00000c440,0x60e00000c4d8) freed by thread T0 here: #0 0x4bf622 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4bf622) #1 0x5072cd (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x5072cd) previously allocated by thread T0 here: #0 0x4bf902 (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x4bf902) #1 0x52edce (/home/icy/real/cflow-1.5-asan/cflow-1.5/install/bin/cflow+0x52edce) Shadow bytes around the buggy address: 0x0c1c7fff9840: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa 0x0c1c7fff9850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c1c7fff9860: 00 00 00 fa fa fa fa fa fa fa fa fa 00 00 00 00 0x0c1c7fff9870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c1c7fff9880: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd =>0x0c1c7fff9890: fd fd fd fd fd fd fd fd fd fd[fd]fa fa fa fa fa 0x0c1c7fff98a0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff98b0: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x0c1c7fff98c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff98d0: fd fd fd fa fa fa fa fa fa fa fa fa fd fd fd fd 0x0c1c7fff98e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==26111==ABORTING The vulnerability was triggered in function reference () at parser.c:1275. (gdb) p &caller->callee $13 = (struct linked_list **) 0x60e00000c4d0 heap-use-after-free on address 0x60e00000c4d0 at pc 0x0000004fd9fa bp 0x7ffd71c71750 sp 0x7ffd71c71748 1266 void 1267 reference(char *name, int line) 1268 { 1269 Symbol *sp = add_reference(name, line); 1270 if (!sp) 1271 return; 1272 if (caller) { 1273 if (!data_in_list(caller, sp->caller)) 1274 linked_list_append(&sp->caller, caller); 1275 if (!data_in_list(sp, caller->callee)) 1276 linked_list_append(&caller->callee, sp); 1277 } 1278 } 1279 Actual results: crash Expected results: crash Additional info: This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact ganshuitao and chaoz.cn if you need more info about the team, the tool or the vulnerability.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle. Changing version to '30.
cflow-1.6-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ef61cfdf11
cflow-1.6-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-f5ae0b5614
cflow-1.6-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-f5ae0b5614
cflow-1.6-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ef61cfdf11
cflow-1.6-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.
cflow-1.6-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.