Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 16 Jul 2015 12:34:13 +0200
From: Agostino Sarubbo <>
Subject: libav: divide-by-zero in ff_h263_decode_mba()

Libav is an open source set of tools for audio and video processing.                                                                                                                                                                                                           
After talking with Luca Barbato which is both a Gentoo and Libav 
developer, I spent a bit of my time fuzzing libav and in particular I 
fuzzed libavcodec though avplay.                                                                                                        
I hit a crash and after I reported it to upstream, they confirmed the 
issue as a divide-by-zero.                                                                                                                                                                               
The complete gdb output:                                                                                                                                                                                                                                                       
ago@...loughby $ gdb --args /usr/bin/avplay avplay.crash                                                                                                                                                                                                                       
GNU gdb (Gentoo 7.7.1 p1) 7.7.1                                                                                                                                                                                                                                                
Copyright (C) 2014 Free Software Foundation, Inc.                                                                                                                                                                                                                              
License GPLv3+: GNU GPL version 3 or later                                                                                                                                                                                                                                     
This is free software: you are free to change and redistribute it.                                                                                                                                                                                                             
There is NO WARRANTY, to the extent permitted by law.  Type "show 
and "show warranty" for details.                                                                                                                                                                                                                                               
This GDB was configured as "x86_64-pc-linux-gnu".                                                                                                                                                                                                                              
Type "show configuration" for configuration details.                                                                                                                                                                                                                           
For bug reporting instructions, please see:                                                                                                                                                                                                                                    
Find the GDB manual and other documentation resources online at:                                                                                                                                                                                                               
For help, type "help".                                                                                                                                                                                                                                                         
Type "apropos word" to search for commands related to "word"...                                                                                                                                                                                                                
Reading symbols from /usr/bin/avplay...Reading symbols from 
(gdb) run                                                                                                                                                                                                                                                                      
Starting program: /usr/bin/avplay avplay.crash                                                                                                                                                                                                                                 
warning: Could not load shared library symbols for                                                                                                                                                                                                            
Do you need "set solib-search-path" or "set sysroot"?                                                                                                                                                                                                                          
[Thread debugging using libthread_db enabled]                                                                                                                                                                                                                                  
Using host libthread_db library "/lib64/".                                                                                                                                                                                                                    
avplay version 11.3, Copyright (c) 2003-2014 the Libav developers                                                                                                                                                                                                              
  built on Jun 19 2015 09:50:59 with gcc 4.8.4 (Gentoo 4.8.4 p1.6, 
[New Thread 0x7fffec4c7700 (LWP 7016)]                                                                                                                                                                                                                                         
[New Thread 0x7fffeb166700 (LWP 7017)]                                                                                                                                                                                                                                         
INFO: AddressSanitizer ignores mlock/mlockall/munlock/munlockall                                                                                                                                                                                                               
[New Thread 0x7fffe9e28700 (LWP 7018)]                                                                                                                                                                                                                                         
[h263 @ 0x60480000f680] Format detected only with low score of 25, 
misdetection possible!                                                                                                                                                                                      
[h263 @ 0x60440001f980] Syntax-based Arithmetic Coding (SAC) not 
[h263 @ 0x60440001f980] Reference Picture Selection not supported                                                                                                                                                                                                              
[h263 @ 0x60440001f980] Independent Segment Decoding not supported                                                                                                                                                                                                             
[h263 @ 0x60440001f980] header damaged                                                                                                                                                                                                                                         
Program received signal SIGFPE, Arithmetic exception.                                                                                                                                                                                                                          
[Switching to Thread 0x7fffe9e28700 (LWP 7018)]                                                                                                                                                                                                                                
0x00007ffff21e3313 in ff_h263_decode_mba (s=s@...ry=0x60720005a100) at 
142     /tmp/portage/media-
video/libav-11.3/work/libav-11.3/libavcodec/ituh263dec.c: No such file 
or directory.                                                                                                                                                                
(gdb) bt                                                                                                                                                                                                                                                                       
#0  0x00007ffff21e3313 in ff_h263_decode_mba (s=s@...ry=0x60720005a100) 
at /tmp/portage/media-
#1  0x00007ffff21f3c2d in ff_h263_decode_picture_header 
(s=0x60720005a100) at /tmp/portage/media-
#2  0x00007ffff1ae16ed in ff_h263_decode_frame (avctx=0x60440001f980, 
data=0x60380002f480, got_frame=0x7fffe9e272f0, avpkt=) at 
#3  0x00007ffff2cd963e in avcodec_decode_video2 (avctx=0x60440001f980, 
avpkt=avpkt@...ry=0x7fffe9e273b0) at /tmp/portage/media-
#4  0x00007ffff44d4fb4 in try_decode_frame (st=st@...ry=0x60340002fb00, 
avpkt=avpkt@...ry=0x601c00037b00, options=) at /tmp/portage/media-
#5  0x00007ffff44ebd89 in avformat_find_stream_info (ic=0x60480000f680, 
options=0x600a00009e80) at /tmp/portage/media-
#6  0x0000000000431834 in decode_thread (arg=0x7ffff7e0b800) at 
#7  0x00007ffff0284b08 in ?? () from /usr/lib64/
#8  0x00007ffff02b4be9 in ?? () from /usr/lib64/
#9  0x00007ffff4e65aa8 in ?? () from /usr/lib/gcc/x86_64-pc-linux-
#10 0x00007ffff0062204 in start_thread () from /lib64/
#11 0x00007fffefda957d in clone () from /lib64/

Affected version:
11.3 (and maybe past versions)

Fixed version:
11.5 and 12.0

Commit fix:;a=commitdiff;h=0a49a62f998747cfa564d98d36a459fe70d3299b;hp=6f4cd33efb5a9ec75db1677d5f7846c60337129f

This bug was discovered by Agostino Sarubbo of Gentoo.


2015-06-21: bug discovered
2015-06-22: bug reported privately to upstream
2015-06-30: upstream commit the fix
2015-07-14: CVE assigned
2015-07-16: advisory release

This bug was found with American Fuzzy Lop.
This bug does not affect ffmpeg.


Agostino Sarubbo
Gentoo Linux Developer

Powered by blists - more mailing lists

Your e-mail address:

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Powered by Openwall GNU/*/Linux - Powered by OpenVZ