Skip to content

OOB in opencv_test_imgcodecs #15560

@c0d3xpl0it

Description

@c0d3xpl0it

We found OOB in opencv_test_imgcodecs binary and OpenCV is complied with clang enabling ASAN.

Machine Setup

Machine : Ubuntu 16.04.3 LTS
OpenCV version: 4.1.2-pre
OpenCV VCS version: 4.1.1-267-ga74fe2e
Build type: Release
Compiler: /usr/bin/clang++  (ver 3.8.0)

Running the binary

fuzzer@fuzzer:~/victim/opencv_build/opencv/build/bin$ ./opencv_test_imgcodecs
CTEST_FULL_OUTPUT
OpenCV version: 4.1.2-pre
OpenCV VCS version: 4.1.1-267-ga74fe2e
Build type: Release
Compiler: /usr/bin/clang++  (ver 3.8.0)
Parallel framework: pthreads
CPU features: SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2
Intel(R) IPP version: ippIP AVX2 (l9) 2019.0.0 Gold (-) Jul 24 2018
OpenCL is disabled
TEST: Skip tests with tags: 'mem_6gb', 'verylong'
[==========] Running 140 tests from 19 test cases.
[----------] Global test environment set-up.
[----------] 11 tests from Imgcodecs_Tiff
[ RUN      ] Imgcodecs_Tiff.decode_tile16384x16384

//SNIPPED//

[----------] 1 test from Imgcodecs_Tiff_Modes
[ RUN      ] Imgcodecs_Tiff_Modes.write_multipage
ASAN:DEADLYSIGNAL
=================================================================
==24899==ERROR: AddressSanitizer: FPE on unknown address 0x7fb08b02b755 (pc 0x7fb08b02b755 bp 0x7ffc71db69f0 sp 0x7ffc71db3360 T0)
    #0 0x7fb08b02b754  (/home/fuzzer/victim/opencv_build/opencv/build/lib/libopencv_imgcodecs.so.4.1+0x103754)
    #1 0x7fb08afc6740  (/home/fuzzer/victim/opencv_build/opencv/build/lib/libopencv_imgcodecs.so.4.1+0x9e740)
    #2 0x5363b0  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x5363b0)
    #3 0x5350e2  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x5350e2)
    #4 0x6282e6  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x6282e6)
    #5 0x628047  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x628047)
    #6 0x62be57  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x62be57)
    #7 0x62da39  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x62da39)
    #8 0x65481c  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x65481c)
    #9 0x653536  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x653536)
    #10 0x652ff6  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x652ff6)
    #11 0x5e6d6a  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x5e6d6a)
    #12 0x7fb0861ec82f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #13 0x43f368  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_imgcodecs+0x43f368)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE (/home/fuzzer/victim/opencv_build/opencv/build/lib/libopencv_imgcodecs.so.4.1+0x103754)
==24899==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions