<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><div>Running dcraw with the attached poc file raises a NULL dereference bug.</div><div><br></div><div>Following gdb log shows the program resulting in segfault.</div></div></div><div><br></div><div><div>jason@debian-amd64-stretch:~/report/debian-latest/dcraw$ gdb dcraw -q</div><div>Reading symbols from dcraw...(no debugging symbols found)...done.</div><div>(gdb) run poc_null</div><div>Starting program: /usr/bin/dcraw poc_null</div><div>[Thread debugging using libthread_db enabled]</div><div>Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".</div><div>poc_null: Unexpected end of file</div><div><br></div><div>Program received signal SIGSEGV, Segmentation fault.</div><div>0x000055555555d01c in ?? ()</div><div>(gdb) x/i $rip</div><div>=> 0x55555555d01c:      mov    %r10w,(%r9,%rax,2)</div><div>(gdb) info reg r9 rax</div><div>r9             0x0      0</div><div>rax            0x0      0</div><div>(gdb) bt 5</div><div>#0  0x000055555555d01c in ?? ()</div><div>#1  0x000055555555b1bc in ?? ()</div><div>#2  0x00007ffff728f2e1 in __libc_start_main (main=0x555555559940, argc=2, argv=0x7fffffffe638, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,</div><div>    stack_end=0x7fffffffe628) at ../csu/libc-start.c:291</div><div>#3  0x000055555555b4da in ?? ()</div></div><div><br></div><div>When we compiled the source with AddressSanitizer, it reports NULL dereference bug in nokia_load_raw() function as follow.</div><div><br></div><div><div>jason@debian-amd64-stretch:~/report/source-latest/dcraw$ ./dcraw-9.27/dcraw poc_null</div><div>poc_null: Unexpected end of file</div><div>ASAN:DEADLYSIGNAL</div><div>=================================================================</div><div>==5981==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000051301a bp 0x7fffffffdc70 sp 0x7fffffffda40 T0)</div><div>    #0 0x513019 in nokia_load_raw /home/jason/report/source-latest/dcraw/dcraw-9.27/dcraw.c:1972:28</div><div>    #1 0x5bcf96 in main /home/jason/report/source-latest/dcraw/dcraw-9.27/dcraw.c:10150:10</div><div>    #2 0x7ffff6a4f2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)</div><div>    #3 0x41c049 in _start (/home/jason/report/source-latest/dcraw/dcraw-9.27/dcraw+0x41c049)</div><div><br></div><div>AddressSanitizer can not provide additional info.</div><div>SUMMARY: AddressSanitizer: SEGV /home/jason/report/source-latest/dcraw/dcraw-9.27/dcraw.c:1972:28 in nokia_load_raw</div><div>==5981==ABORTING</div></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=UTF-8), LANGUAGE=en_US:en (charmap=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>-- no debconf information</div><div><br></div></div>