Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 607896 - <app-misc/pax-utils-1.2.3: dumpelf: two invalid memory read with corrupt program headers
Summary: <app-misc/pax-utils-1.2.3: dumpelf: two invalid memory read with corrupt prog...
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:
Whiteboard: B3 [noglsa]
Keywords:
Depends on: 608766
Blocks:
  Show dependency tree
 
Reported: 2017-02-01 09:38 UTC by Agostino Sarubbo
Modified: 2018-04-08 13:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: No


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2017-02-01 09:38:20 UTC
This was privately disclosed to vapier which invited me to file a bug here.

I found two invalid memory read in dumpelf. 
Both reproducible with "dumpelf $FILE"

1)
  SEGV on unknown address 0x7f8d94dc9e28 (pc 0x00000051efc6 bp 0x7ffe15ddbfa0 
sp 0x7ffe15ddbf60 T0)
==31647==The signal is caused by a READ memory access.

#0  0x00000000004067f7 in dump_dyn (dyn_void=dyn_void@entry=0x7ff5f7ff6e28, 
dyn_cnt=dyn_cnt@entry=0, elf=0x60d8e0, elf=0x60d8e0) at dumpelf.c:486
#1  0x0000000000401e24 in dumpelf (file_cnt=0, filename=<optimized out>) at 
dumpelf.c:146
#2  parseargs (argv=0x7fffffffe1a8, argc=2) at dumpelf.c:557
#3  main (argc=2, argv=0x7fffffffe1a8) at dumpelf.c:566

Reproducer:
https://github.com/asarubbo/poc/blob/master/00140-pax-utils-dumpelf-invalidread-dump_dyn



2)
 SEGV on unknown address 0x6360e1292000 (pc 0x00000051fba9 bp 0x7ffeef817f20 
sp 0x7ffeef817ec0 T0)
==8213==The signal is caused by a READ memory access.

#0  dump_notes (B=B@entry=64, memory=memory@entry=0x63fff7ff5000, 
memory_end=0x6414f7ff5000, elf=0x60d8e0, elf=0x60d8e0) at dumpelf.c:228
#1  0x0000000000405636 in dump_phdr (elf=elf@entry=0x60d8e0, 
phdr_void=phdr_void@entry=0x7ffff7ff50f0, phdr_cnt=phdr_cnt@entry=1) at 
dumpelf.c:324
#2  0x0000000000401dd9 in dumpelf (file_cnt=0, filename=<optimized out>) at 
dumpelf.c:91
#3  parseargs (argv=0x7fffffffe1a8, argc=2) at dumpelf.c:557
#4  main (argc=2, argv=0x7fffffffe1a8) at dumpelf.c:566

Reproducer:
https://github.com/asarubbo/poc/blob/master/00141-pax-utils-dumpelf-invalidread-dump_notes

If you need something else feel free to ask.
Comment 1 SpanKY gentoo-dev 2017-02-01 23:08:58 UTC
should be fixed here:
https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=18ded0e30ee5a84260cceb80d818b9c21ade4c76

not planning on doing an update right away since dumpelf is a programming tool that no one really runs directly
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2018-02-04 19:15:48 UTC
to confirm it's not in the latest release

git describe --tags 18ded0e30ee5a84260cceb80d818b9c21ade4c76
v1.2.2-2-g18ded0e
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2018-03-11 05:28:53 UTC
This is fixed in app-misc/pax-utils-1.2.3 and newer.
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2018-03-11 05:29:32 UTC
This one was assigned to security so re-opening.
Comment 5 Doug Goldstein (RETIRED) gentoo-dev 2018-03-11 05:29:46 UTC
This one was assigned to security so re-opening.
Comment 6 Christopher Díaz Riveros (RETIRED) gentoo-dev Security 2018-03-11 16:26:15 UTC
@Maintainers please call for stabilization when ready.

Thank you
Comment 7 Aaron Bauman (RETIRED) gentoo-dev 2018-03-23 21:25:55 UTC
@arches, please stabilize.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-23 23:40:41 UTC
ia64 stable
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-24 11:15:37 UTC
ppc/ppc64 stable
Comment 10 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-03-24 11:16:46 UTC
amd64 stable
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2018-03-24 19:33:12 UTC
hppa stable
Comment 12 Thomas Deutschmann (RETIRED) gentoo-dev 2018-03-25 22:46:04 UTC
x86 stable
Comment 13 Mart Raudsepp gentoo-dev 2018-03-28 19:47:05 UTC
arm64 stable
Comment 14 Tobias Klausmann (RETIRED) gentoo-dev 2018-03-31 10:12:40 UTC
Stable on alpha.
Comment 15 Markus Meier gentoo-dev 2018-04-08 10:46:52 UTC
arm stable, all arches done.
Comment 16 Larry the Git Cow gentoo-dev 2018-04-08 13:08:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d7a5a014319335d947d6f162c4b91e1d00ba139

commit 7d7a5a014319335d947d6f162c4b91e1d00ba139
Author:     Aaron Bauman <bman@gentoo.org>
AuthorDate: 2018-04-08 13:07:57 +0000
Commit:     Aaron Bauman <bman@gentoo.org>
CommitDate: 2018-04-08 13:07:57 +0000

    app-misc/pax-utils: drop vulnerable
    
    Bug: https://bugs.gentoo.org/607896
    Package-Manager: Portage-2.3.28, Repoman-2.3.9

 app-misc/pax-utils/Manifest                  |  2 -
 app-misc/pax-utils/pax-utils-1.1.7.ebuild    | 56 -------------------------
 app-misc/pax-utils/pax-utils-1.2.2-r2.ebuild | 62 ----------------------------
 3 files changed, 120 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b23a73f6a51d28568444f367daf1af963db31bf

commit 1b23a73f6a51d28568444f367daf1af963db31bf
Author:     Aaron Bauman <bman@gentoo.org>
AuthorDate: 2018-04-08 13:06:48 +0000
Commit:     Aaron Bauman <bman@gentoo.org>
CommitDate: 2018-04-08 13:06:48 +0000

    app-misc/pax-utils: stabilize ppc
    
    per Sergei's comment ppc/ppc64 is stable, but keyword was missed.
    
    Bug: https://bugs.gentoo.org/607896
    Package-Manager: Portage-2.3.28, Repoman-2.3.9

 app-misc/pax-utils/pax-utils-1.2.3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 17 Aaron Bauman (RETIRED) gentoo-dev 2018-04-08 13:10:37 UTC
GLSA Vote: No