Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 572428 - <app-arch/cpio-2.12-r1: out-of-bounds write
Summary: <app-arch/cpio-2.12-r1: out-of-bounds write
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: https://lists.gnu.org/archive/html/bu...
Whiteboard: B3 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 09:35 UTC by Agostino Sarubbo
Modified: 2017-07-16 00:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2016-01-20 09:35:42 UTC
From ${URL} :

An out-of-bounds write in cpio 2.11 was found in the parsing of cpio files
(other version are probably affected).  Find attached a test case to
reproduce it. The ASAN report is here:

=================================================================
==5480==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x60200000edd0 at pc 0x41f187 bp 0x7fffffffdc50 sp 0x7fffffffdc48
WRITE of size 2 at 0x60200000edd0 thread T0
    #0 0x41f186 in cpio_safer_name_suffix
/home/g/Codigo/cpio-2.11+dfsg/src/util.c:1392
    #1 0x40b3d7 in process_copy_in
/home/g/Codigo/cpio-2.11+dfsg/src/copyin.c:1391
    #2 0x416754 in main /home/g/Codigo/cpio-2.11+dfsg/src/main.c:739
    #3 0x7ffff6b5eec4 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
    #4 0x403408 (/home/g/Codigo/cpio-2.11+dfsg/src/cpio+0x403408)

0x60200000edd1 is located 0 bytes to the right of 1-byte region
[0x60200000edd0,0x60200000edd1)
allocated by thread T0 here:
    #0 0x7ffff6f567ef in __interceptor_malloc
(/usr/lib/x86_64-linux-gnu/libasan.so.1+0x547ef)
    #1 0x440f3e in xmalloc /home/g/Codigo/cpio-2.11+dfsg/gnu/xmalloc.c:47
    #2 0x409c74 in read_in_new_ascii
/home/g/Codigo/cpio-2.11+dfsg/src/copyin.c:1166
    #3 0x408a26 in read_in_header
/home/g/Codigo/cpio-2.11+dfsg/src/copyin.c:1043
    #4 0x40b354 in process_copy_in
/home/g/Codigo/cpio-2.11+dfsg/src/copyin.c:1361
    #5 0x416754 in main /home/g/Codigo/cpio-2.11+dfsg/src/main.c:739
    #6 0x7ffff6b5eec4 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)

SUMMARY: AddressSanitizer: heap-buffer-overflow
/home/g/Codigo/cpio-2.11+dfsg/src/util.c:1392 cpio_safer_name_suffix
Shadow bytes around the buggy address:
  0x0c047fff9d60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9d70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa[01]fa fa fa 06 fa
  0x0c047fff9dc0: fa fa 05 fa fa fa 00 04 fa fa 00 04 fa fa 00 04
  0x0c047fff9dd0: fa fa 00 04 fa fa 00 04 fa fa 00 04 fa fa 00 04
  0x0c047fff9de0: fa fa 00 04 fa fa 00 04 fa fa 00 04 fa fa 00 04
  0x0c047fff9df0: fa fa 00 04 fa fa 00 04 fa fa 00 04 fa fa fd fa
  0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==5480==ABORTING


This issue was found using QuickFuzz.



@maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
Comment 1 SpanKY gentoo-dev 2016-02-14 19:49:08 UTC
fixed in 2.12-r1:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a7c109933aac0f9de580513346ebe94f3acd4f2

should be fine for stable
Comment 2 Aaron Bauman (RETIRED) gentoo-dev 2016-02-15 03:42:37 UTC
Arches please stabilize
Comment 3 Joshua Kinard gentoo-dev 2016-02-15 04:19:09 UTC
mips doesn't have a stable keyword.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2016-02-17 16:47:36 UTC
Stable for HPPA PPC64.
Comment 5 Richard Freeman gentoo-dev 2016-02-20 12:14:32 UTC
amd64 stable
Comment 6 Markus Meier gentoo-dev 2016-02-20 14:26:46 UTC
arm stable
Comment 7 Tobias Klausmann (RETIRED) gentoo-dev 2016-03-14 20:00:53 UTC
Stable on alpha.
Comment 8 Agostino Sarubbo gentoo-dev 2016-03-15 16:41:52 UTC
x86 stable
Comment 9 Agostino Sarubbo gentoo-dev 2016-03-16 12:05:24 UTC
ppc stable
Comment 10 Agostino Sarubbo gentoo-dev 2016-03-19 11:38:07 UTC
sparc stable
Comment 11 Agostino Sarubbo gentoo-dev 2016-03-20 12:02:08 UTC
ia64 stable
Comment 12 Aaron Bauman (RETIRED) gentoo-dev 2016-07-19 11:33:21 UTC
Removing unstable arches.

@maintainer(s), please clean the vulnerable versions.
Comment 13 Yury German Gentoo Infrastructure gentoo-dev 2017-06-11 00:21:11 UTC
This has been around for almost 1 year now, can we please clean up.
Comment 14 Thomas Deutschmann (RETIRED) gentoo-dev 2017-06-11 10:26:04 UTC
Cleanup PR: https://github.com/gentoo/gentoo/pull/4909
Comment 15 Aaron Bauman (RETIRED) gentoo-dev 2017-07-16 00:43:16 UTC
Downgraded due to no PoC for ACE/RCE.

GLSA Vote: No

Tree is clean.