Skip to content

OOB in opencv_test_core #15558

@c0d3xpl0it

Description

@c0d3xpl0it

We found OOB in opencv_test_core 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_core
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 11409 tests from 239 test cases.
[----------] Global test environment set-up.
[----------] 16 tests from CommandLineParser
[ RUN      ] CommandLineParser.testFailure
[       OK ] CommandLineParser.testFailure (0 ms)
[ RUN      ] CommandLineParser.testHas_noValues
[       OK ] CommandLineParser.testHas_noValues (0 ms)

// SNIPPED //

/home/fuzzer/victim/opencv_build/opencv/modules/core/test/test_io.cpp:712: Failure
Expected equality of these values:
  _2d_in.dims
    Which is: 0
  _2d_out.dims
    Which is: 2
ASAN:DEADLYSIGNAL
=================================================================
==8986==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000b87e48 bp 0x7ffde22b6030 sp 0x7ffde22b36c0 T0)
    #0 0xb87e47  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0xb87e47)
    #1 0xb7ef22  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0xb7ef22)
    #2 0x23201e6  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x23201e6)
    #3 0x231ff47  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x231ff47)
    #4 0x2323d57  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x2323d57)
    #5 0x2325939  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x2325939)
    #6 0x234c71c  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x234c71c)
    #7 0x234b436  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x234b436)
    #8 0x234aef6  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x234aef6)
    #9 0xfd72b4  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0xfd72b4)
    #10 0x7f706239b82f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #11 0x53c8b8  (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0x53c8b8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/fuzzer/victim/opencv_build/opencv/build/bin/opencv_test_core+0xb87e47)
==8986==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