<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Package: dcraw</div><div>Version: 9.27-1+b1</div><div>Severity: normal</div><div><br></div><div>Dear Maintainer,</div><div><br></div><div><div>Running 'dcparse' program of 'dcraw-9.27' package with the attached input file raises a crash caused by stack-overflow in parse_mos().<br></div><div><br></div><div>First, below is the GDB log that shows crash from dcparse binary downloaded with 'apt-get'.</div><div>----------------------------------------------------------------------------------------</div></div><div><div>jason@debian-amd64-stretch:~/dcparse-crashes$ ulimit -c unlimited</div><div>jason@debian-amd64-stretch:~/dcparse-crashes$ dcparse ./crash-0_00025607 > /dev/null</div><div>Segmentation fault (core dumped)</div><div>jason@debian-amd64-stretch:~/dcparse-crashes$ gdb -q dcparse core</div><div>Reading symbols from dcparse...(no debugging symbols found)...done.</div><div>[New LWP 1372]</div><div>Core was generated by `dcparse ./crash-0_00025607'.</div><div>Program terminated with signal SIGSEGV, Segmentation fault.</div><div>#0  0x00007ffff753389b in __GI__IO_padn (fp=fp@entry=0x7ffff7865600 <_IO_2_1_stdout_>, pad=pad@entry=32, count=count@entry=47362) at iopadn.c:56</div><div>56      iopadn.c: No such file or directory.</div><div>(gdb) where</div><div>#0  0x00007ffff753389b in __GI__IO_padn (fp=fp@entry=0x7ffff7865600 <_IO_2_1_stdout_>, pad=pad@entry=32, count=count@entry=47362) at iopadn.c:56</div><div>#1  0x00007ffff7512e3b in _IO_vfprintf_internal (s=0x7ffff7865600 <_IO_2_1_stdout_>, format=<optimized out>, ap=ap@entry=0x7fffff80af08) at vfprintf.c:1637</div><div>#2  0x00007ffff75c1c0f in ___printf_chk (flag=1, format=<optimized out>) at printf_chk.c:35</div><div>#3  0x00005555555562f6 in ?? ()</div><div>#4  0x00005555555564a6 in ?? ()</div><div>#5  0x00005555555564a6 in ?? ()</div><div>#6  0x00005555555564a6 in ?? ()</div><div>-------------------------------------------------------------------------------------<br></div></div><div><br></div><div>Since the downloaded binary did not have any symbol information, we downloaded its code and compiled it with AddressSanitizer. </div><div>AddressSanitizer reported a stack overflow in parse_mos(), as below.</div><div>-------------------------------------------------------------------------------------  <br></div><div><div>=================================================================</div><div>==16203==ERROR: AddressSanitizer: stack-overflow on address 0x7fffff7feff8 (pc 0x7ffff6ce4bfa bp 0x62100001cd00 sp 0x7fffff7ff000 T0)</div><div>    #0 0x7ffff6ce4bf9 in _IO_file_write /build/glibc-Cl5G7W/glibc-2.23/libio/fileops.c:1263</div><div>    #1 0x7ffff6ce6408 in new_do_write /build/glibc-Cl5G7W/glibc-2.23/libio/fileops.c:518</div><div>    #2 0x7ffff6ce6408 in _IO_do_write /build/glibc-Cl5G7W/glibc-2.23/libio/fileops.c:494</div><div>    #3 0x7ffff6ce547c in _IO_file_xsputn /build/glibc-Cl5G7W/glibc-2.23/libio/fileops.c:1331</div><div>    #4 0x7ffff6cdafbd in _IO_padn /build/glibc-Cl5G7W/glibc-2.23/libio/iopadn.c:56</div><div>    #5 0x7ffff6cbab1b in _IO_vfprintf /build/glibc-Cl5G7W/glibc-2.23/stdio-common/vfprintf.c:1632</div><div>    #6 0x460f07 in __interceptor_vprintf (/home/jason/Chatkey/replay_box/dcparse+0x460f07)</div><div>    #7 0x460fd7 in printf (/home/jason/Chatkey/replay_box/dcparse+0x460fd7)</div><div>    #8 0x4ef0be in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:670:5</div><div>    #9 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div></div><div><div>    #10 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #11 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #12 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #13 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #14 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #15 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #16 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #17 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #18 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #19 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div><div>    #20 0x4ef377 in parse_mos /home/jason/packages-sanitize/dcraw-9.27/parse.c:690:5</div></div><div>   ... </div><div>   ...</div><div>  ...</div><div><div>SUMMARY: AddressSanitizer: stack-overflow /build/glibc-Cl5G7W/glibc-2.23/libio/fileops.c:1263 in _IO_file_write</div><div>==16203==ABORTING</div></div><div>-------------------------------------------------------------------------------------  <br></div><div><br></div><div><br></div><div>-- System Information:</div><div>Debian Release: 9.1</div><div>  APT prefers stable-updates</div><div>  APT policy: (500, 'stable-updates'), (500, 'stable')</div><div>Architecture: amd64 (x86_64)</div><div><br></div><div>Kernel: Linux 4.9.0-3-amd64 (SMP w/1 CPU core)</div><div>Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=locale: Cannot set LC_ALL to default locale: No such file or directory</div><div>UTF-8), LANGUAGE=en_US:en (charmap=locale: Cannot set LC_ALL to default locale: No such file or directory</div><div>UTF-8)</div><div>Shell: /bin/sh linked to /bin/dash</div><div>Init: systemd (via /run/systemd/system)</div><div><br></div><div>Versions of packages dcraw depends on:</div><div>ii  libc6            2.24-11+deb9u3</div><div>ii  libjpeg62-turbo  1:1.5.1-2</div><div>ii  liblcms2-2       2.8-4</div><div><br></div><div>dcraw recommends no packages.</div><div><br></div><div>Versions of packages dcraw suggests:</div><div>pn  gphoto2  <none></div><div>ii  netpbm   2:10.0-15.3+b2</div><div><br></div><div>-- debconf information excluded</div></div></div></div></div></div>