Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmls hangs due to infinite looping of dos_load_ext_table(). #914

Closed
adambuchbinder opened this issue Aug 25, 2017 · 0 comments
Closed

mmls hangs due to infinite looping of dos_load_ext_table(). #914

adambuchbinder opened this issue Aug 25, 2017 · 0 comments

Comments

@adambuchbinder
Copy link
Contributor

adambuchbinder commented Aug 25, 2017

To reproduce:

$ base64 -d > hang.zip 
UEsDBBQAAAAIADVqGUtBe/v3KgAAAAAGAAAIABwA
aGFuZy5pbWdVVAkAA+aFoFnshaBZdXgLAAEEYTkC
AASIEwAAY2AYBUMRpOyvLQbRTAzNQMwIZDHiUMkK
pRuwyIWuooHTRsEoGAVDBAAAUEsBAh4DFAAAAAgA
NWoZS0F7+/cqAAAAAAYAAAgAGAAAAAAAAAAAAICB
AAAAAGhhbmcuaW1nVVQFAAPmhaBZdXgLAAEEYTkC
AASIEwAAUEsFBgAAAAABAAEATgAAAGwAAAAAAA==
$ unzip hang.zip
Archive:  hang.zip
  inflating: hang.img
$ mmls -t dos hang.img
[hangs here]

This bug was found using american fuzzy lop and input files ultimately from files.fuzzing-project.org.

Backtrace:

^C
Program received signal SIGINT, Interrupt.
0x0000000000412a3a in tsk_vs_part_add (a_vs=a_vs@entry=0x637d40, 
    a_start=a_start@entry=0, len=len@entry=128, 
    type=type@entry=TSK_VS_PART_FLAG_META, 
    desc=0xab57f0 "DOS Extended (0x05)", table=table@entry=-40 '\330', 
    slot=slot@entry=2 '\002') at mm_part.c:98
98	        else if (cur_part->next->start > part->start) {
(gdb) bt
#0  0x0000000000412a3a in tsk_vs_part_add (a_vs=a_vs@entry=0x637d40, 
    a_start=a_start@entry=0, len=len@entry=128, 
    type=type@entry=TSK_VS_PART_FLAG_META, 
    desc=0x8010d0 "DOS Extended (0x05)", table=table@entry=126 '~', 
    slot=slot@entry=2 '\002') at mm_part.c:98
#1  0x0000000000422a89 in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=1918) at dos.c:757
#2  0x0000000000422c6c in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=1917) at dos.c:773
#3  0x0000000000422c6c in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=1916) at dos.c:773
[...]
#1916 0x0000000000422c6c in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=3) at dos.c:773
#1917 0x0000000000422c6c in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=2) at dos.c:773
#1918 0x0000000000422c6c in dos_load_ext_table (vs=vs@entry=0x637d40, 
    sect_cur=sect_cur@entry=0, sect_ext_base=sect_ext_base@entry=0, 
    table=table@entry=1) at dos.c:773
#1919 0x0000000000423d37 in dos_load_prim_table (test=<optimized out>, 
    vs=0x637d40) at dos.c:983
#1920 tsk_vs_dos_open (img_info=<optimized out>, offset=<optimized out>, 
    test=<optimized out>) at dos.c:1064
#1921 0x00000000004113cd in tsk_vs_open (img_info=0x7ffff7f92010, offset=0, 
    type=<optimized out>) at mm_open.c:56
#1922 0x0000000000401e47 in main (argc=2, argv1=<optimized out>)
    at mmls.cpp:280

Input: See above. I can't attach the zip file, for unknown reasons.

bcarrier added a commit that referenced this issue Sep 5, 2017
Avoid infinite loop in dos_load_ext_table(). (Fixes: #914)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant