Bug 1293139

Summary: Invalid memory access in getmntent_r()
Product: [Fedora] Fedora Reporter: Jon Burgess <jburgess777>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 23CC: arjun.is, codonell, fweimer, jakub, law, mfabian, pfrankli, siddhesh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.22-15.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 18:51:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test code from upstream bug report none

Description Jon Burgess 2015-12-20 15:45:03 UTC
Created attachment 1108003 [details]
Test code from upstream bug report

Description of problem: Running valgrind on any program using getmntent() shows an invalid memory access in getmntent_r(). The bug has been fixed in the upstream glibc.


Version-Release number of selected component (if applicable):
glibc-2.22-6.fc23.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. gcc test.c
2. valgrind ./a.out

Actual results:

==21800== Invalid read of size 1
==21800==    at 0x4F2EE74: getmntent_r (mntent_r.c:139)
==21800==    by 0x4005FC: main (in /home/jburgess/a.out)
==21800==  Address 0x51f62af is 1 bytes before a block of size 4,096 alloc'd
==21800==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21800==    by 0x4F2EC99: allocate (mntent.c:35)
==21800==    by 0x4F2EC99: getmntent (mntent.c:44)
==21800==    by 0x4005FC: main (in /home/jburgess/a.out)


Expected results:


Additional info:

Upstream glibc report: https://sourceware.org/bugzilla/show_bug.cgi?id=18887

Comment 1 Fedora Update System 2016-05-07 17:20:43 UTC
glibc-2.22-15.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35

Comment 2 Fedora Update System 2016-05-08 16:26:04 UTC
glibc-2.22-15.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35

Comment 3 Florian Weimer 2016-05-09 09:44:06 UTC
Already fixed upstream prior to the 2.23 release:

commit b0e805fa0d6fea33745952df7b7f5442ca4c374f
Author: Mike Frysinger <vapier>
Date:   Fri Aug 28 17:08:49 2015 -0400

    getmntent: fix memory corruption w/blank lines [BZ #18887]

Comment 4 Fedora Update System 2016-05-10 17:58:12 UTC
glibc-2.22-15.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.