bugCompact Disc Input and Control Library - Bugs: bug #52264, NULL Pointer Dereference in...

 
 

bug #52264: NULL Pointer Dereference in realloc_symlink

Submitted by:  Zhao Liang <zhao_liang>
Submitted on:  Mon 23 Oct 2017 08:25:35 AM UTC  
 
Category:  utility program Severity:  5 - Average
Item Group:  iso-info Status:  Fixed
Privacy:  Public Assigned to:  Rocky Bernstein <rocky>
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 22 Nov 2017 01:24:49 AM UTC, comment #1:

The current git sources should address this.

There will be 1.0.0 release soon.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Mon 23 Oct 2017 08:25:35 AM UTC, original submission:

## Tested Version:
libcdio v0.94

## How reproducible:
iso-info -i $POC

## Description:
In realloc_symlink function, this code
69 memcpy(psz_newsymlink, p_stat->rr.psz_symlink, p_stat->rr.i_symlink);
want to memcpy a buffer, but failed to check the source buffer address. With the POC file, p_stat->rr.psz_symlink was set to NULL and lead to crashes.

## Crash Information:
The output with address sanitizer enabled
./iso-info -i cdio.realloc_symlink.rock.69.crash
iso-info version 0.94 x86_64-pc-linux-gnu
Copyright (c) 2003-2005, 2007-2008, 2011-2015 R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
________________________________
ISO 9660 image: cdio.realloc_symlink.rock.69.crash
System : LINUX
Volume : CDROM
Volume Set :

No Joliet extensions
________________________________
ISO-9660 Information
++ WARN: from_733: broken byte order
++ WARN: Symlink component flag not implemented
ASAN:SIGSEGV
=================================================================
==20153==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f17d96a2f20 bp 0x7ffec3bb8950 sp 0x7ffec3bb80d8 T0)
#0 0x7f17d96a2f1f (/lib/x86_64-linux-gnu/libc.so.6+0x160f1f)
#1 0x7f17d99985d0 in __asan_memcpy (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8c5d0)
#2 0x41ae44 in realloc_symlink /root/libcdio-0.94/lib/iso9660/rock.c:69
#3 0x41c74c in get_rock_ridge_filename /root/libcdio-0.94/lib/iso9660/rock.c:304
#4 0x416e8d in _iso9660_dir_to_statbuf /root/libcdio-0.94/lib/iso9660/iso9660_fs.c:751
#5 0x4198d7 in iso9660_ifs_readdir /root/libcdio-0.94/lib/iso9660/iso9660_fs.c:1393
#6 0x403044 in print_iso9660_recurse /root/libcdio-0.94/src/iso-info.c:224
#7 0x4037b0 in print_iso9660_fs /root/libcdio-0.94/src/iso-info.c:309
#8 0x404571 in main /root/libcdio-0.94/src/iso-info.c:501
#9 0x7f17d956282f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#10 0x402798 in _start (/opt/asan/bin/iso-info+0x402798)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 ??
==20153==ABORTING

## CREDIT
Zhao Liang, Huawei Weiran Labs

## POC file

Zhao Liang <zhao_liang>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #42233:  cdio.realloc_symlink.rock.69.crash added by zhao_liang (48KiB - application/octet-stream - POC file that crashing catdoc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rocky (Posted a comment)
  • -email is unavailable- added by zhao_liang (Submitted the item)
  • -email is unavailable- added by zhao_liang
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-22 rocky StatusNone => Fixed
        Assigned toNone => rocky
    2017-10-23 zhao_liang Attached File- => Added cdio.realloc_symlink.rock.69.crash, #42233
        Carbon-Copy- => Added rocky

    Back to the top


    Powered by Savane 3.3