[Debian-astro-maintainers] Bug#914453: dcraw-9.27-1 : stack-buffer-overflow in quicktake_100_load_raw()

Jaeseung Choi jschoi.2022 at gmail.com
Fri Nov 23 15:30:57 GMT 2018


Package: dcraw
Version: 9.27-1+b1
Severity: normal

Dear Maintainer,

Running dcraw-9.27 with the attached input file raises a crash caused by
stack-buffer-overflow in quicktake_100_load_raw().

First, below is the GDB log that shows a crash from dcraw-9.27 binary
downloaded with 'apt-get'.
----------------------------------------------------------------------------------------
jason at debian-amd64-stretch:~/dcraw-crashes$ gdb -q dcraw
Reading symbols from dcraw...(no debugging symbols found)...done.
(gdb) run crash-2_00000011
Starting program: /usr/bin/dcraw crash-2_00000011
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
crash-2_00000011: Unexpected end of file

Program received signal SIGSEGV, Segmentation fault.
0x000055555555dd08 in ?? ()
(gdb) x/i $rip
=> 0x55555555dd08:      mov    %al,(%r15)
(gdb) info reg r15
r15            0x7ffffffff000   140737488351232
-------------------------------------------------------------------------------------

Since the downloaded binary did not have any symbol information, we
downloaded its source code and compiled it with AddressSanitizer.
AddressSanitizer reported a stack-based buffer overflow in
quicktake_100_load_raw(), as below.
-------------------------------------------------------------------------------------
=================================================================
==5011==ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7fffffffd931 at pc 0x000000516332 bp 0x7ffffffb1410 sp 0x7ffffffb1408
WRITE of size 1 at 0x7fffffffd931 thread T0
    #0 0x516331 in quicktake_100_load_raw
/home/jason/packages-sanitize/dcraw-9.27/dcraw.c:2145:23
    #1 0x5bc6e6 in main
/home/jason/packages-sanitize/dcraw-9.27/dcraw.c:10150:10
    #2 0x7ffff6a3582f in __libc_start_main
/build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
    #3 0x4196c8 in _start (/home/jason/Chatkey/replay_box/dcraw+0x4196c8)

Address 0x7fffffffd931 is located in stack of thread T0 at offset 311729 in
frame
    #0 0x515d9f in quicktake_100_load_raw
/home/jason/packages-sanitize/dcraw-9.27/dcraw.c:2116

  This frame has 1 object(s):
    [32, 311728) 'pixel' <== Memory access at offset 311729 overflows this
variable
HINT: this may be a false positive if your program uses some custom stack
unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow
/home/jason/packages-sanitize/dcraw-9.27/dcraw.c:2145:23 in
quicktake_100_load_raw
Shadow bytes around the buggy address:
  0x10007fff7ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10007fff7b20: 00 00 00 00 00 00[f3]f3 f3 f3 f3 f3 f3 f3 f3 f3
  0x10007fff7b30: f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3
  0x10007fff7b40: f3 f3 f3 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00
  0x10007fff7b50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7b70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
==5011==ABORTING

-------------------------------------------------------------------------------------


-- System Information:
Debian Release: 9.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/1 CPU core)
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
UTF-8), LANGUAGE=en_US:en (charmap=locale: Cannot set LC_ALL to default
locale: No such file or directory
UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dcraw depends on:
ii  libc6            2.24-11+deb9u3
ii  libjpeg62-turbo  1:1.5.1-2
ii  liblcms2-2       2.8-4

dcraw recommends no packages.

Versions of packages dcraw suggests:
pn  gphoto2  <none>
ii  netpbm   2:10.0-15.3+b2

-- debconf information excluded
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-astro-maintainers/attachments/20181124/cae4e176/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-2_00000011
Type: application/octet-stream
Size: 16 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-astro-maintainers/attachments/20181124/cae4e176/attachment-0001.obj>


More information about the Debian-astro-maintainers mailing list