Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak in sgi #428

Closed
bestshow opened this issue Apr 17, 2017 · 3 comments
Closed

memory leak in sgi #428

bestshow opened this issue Apr 17, 2017 · 3 comments

Comments

@bestshow
Copy link

bestshow commented Apr 17, 2017

on ImageMagick latest version

#identify $FILE

Direct leak of 4160 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a18590 in __interceptor_posix_memalign ../../../../libsanitizer/asan/asan_malloc_linux.cc:128
#1 0x43ec4c in AcquireAlignedMemory MagickCore/memory.c:261
#2 0x43ed71 in AcquireVirtualMemory MagickCore/memory.c:578
#3 0x68d683 in ReadSGIImage coders/sgi.c:452
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

Direct leak of 4160 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a18590 in __interceptor_posix_memalign ../../../../libsanitizer/asan/asan_malloc_linux.cc:128
#1 0x43ec4c in AcquireAlignedMemory MagickCore/memory.c:261
#2 0x43ed71 in AcquireVirtualMemory MagickCore/memory.c:578
#3 0x68d1d7 in ReadSGIImage coders/sgi.c:385
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a17b58 in __interceptor_malloc ../../../../libsanitizer/asan/asan_malloc_linux.cc:62
#1 0x43ecdb in AcquireMagickMemory MagickCore/memory.c:463
#2 0x43ed2f in AcquireQuantumMemory MagickCore/memory.c:536
#3 0x68d661 in ReadSGIImage coders/sgi.c:450
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a17b58 in __interceptor_malloc ../../../../libsanitizer/asan/asan_malloc_linux.cc:62
#1 0x43ecdb in AcquireMagickMemory MagickCore/memory.c:463
#2 0x43ed2f in AcquireQuantumMemory MagickCore/memory.c:536
#3 0x68d633 in ReadSGIImage coders/sgi.c:448
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a18590 in __interceptor_posix_memalign ../../../../libsanitizer/asan/asan_malloc_linux.cc:128
#1 0x43ec4c in AcquireAlignedMemory MagickCore/memory.c:261
#2 0x43ef59 in AcquireVirtualMemory MagickCore/memory.c:608
#3 0x68d1d7 in ReadSGIImage coders/sgi.c:385
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7f6a48a18590 in __interceptor_posix_memalign ../../../../libsanitizer/asan/asan_malloc_linux.cc:128
#1 0x43ec4c in AcquireAlignedMemory MagickCore/memory.c:261
#2 0x43ef59 in AcquireVirtualMemory MagickCore/memory.c:608
#3 0x68d683 in ReadSGIImage coders/sgi.c:452
#4 0x7f23d8 in ReadImage MagickCore/constitute.c:497
#5 0x9e4e89 in ReadStream MagickCore/stream.c:1045
#6 0x7f1486 in PingImage MagickCore/constitute.c:226
#7 0x7f1a39 in PingImages MagickCore/constitute.c:327
#8 0xbba496 in IdentifyImageCommand MagickWand/identify.c:319
#9 0xc10fea in MagickCommandGenesis MagickWand/mogrify.c:183
#10 0x40f839 in MagickMain utilities/magick.c:149
#11 0x40fa06 in main utilities/magick.c:180
#12 0x7f6a43d26b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

8464 byte(s) leaked in 6 allocation(s).

testcase:
https://github.com/bestshow/p0cs/blob/master/memory-leak-in-sgi

Author: ADLab of Venustech

dlemstra added a commit that referenced this issue Apr 17, 2017
dlemstra added a commit that referenced this issue Apr 17, 2017
@dlemstra
Copy link
Member

Can you give it another try with the code from our git repository (or wait for the next beta). Feel free to close the issue if you think this is resolved.

@bestshow
Copy link
Author

The issue is resolved.

@Whissi
Copy link

Whissi commented May 22, 2017

This is CVE-2017-7941.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants