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
|