Bug 1622674

Summary: glibc: Fix memory overread when regex pattern contains NUL byte
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 29CC: arjun, codonell, dj, fweimer, law, mfabian, pfrankli, rth, siddhesh
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glibc-2.28.9000-2.fc30 glibc-2.28-8.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1622678 (view as bug list) Environment:
Last Closed: 2019-11-05 14:43:51 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:
Bug Depends On:    
Bug Blocks: 1622678    

Description Florian Weimer 2018-08-27 17:48:48 UTC
Quoting Assaf Gordon in <https://lists.gnu.org/r/bug-gnulib/2018-08/msg00142.html>:

“
1. The input regex contains multibyte character with
   different uppper/lower case representation.
2. The input regex also contains a NUL character.
”

Upstream commit:

commit bc680b336971305cb39896b30d72dc7101b62242
Author: Paul Eggert <eggert.edu>
Date:   Sat Aug 25 20:34:34 2018 -0700

    regex: fix uninitialized memory access
    
    I introduced this bug into gnulib in commit
    8335a4d6c7b4448cd0bcb6d0bebf1d456bcfdb17 dated 2006-04-10;
    eventually it was merged into glibc.  The bug was found by
    project-repo <bugs> and reported here:
    https://lists.gnu.org/r/sed-devel/2018-08/msg00017.html
    Diagnosis and draft fix reported by Assaf Gordon here:
    https://lists.gnu.org/r/bug-gnulib/2018-08/msg00071.html
    https://lists.gnu.org/r/bug-gnulib/2018-08/msg00142.html
    * posix/regex_internal.c (build_wcs_upper_buffer):
    Fix bug when mbrtowc returns 0.

Comment 1 Florian Weimer 2018-08-28 09:39:28 UTC
Note that there are upstream reports that this bug does not affect glibc, only the code in gnulib.  I do not think this is true.

Comment 2 Fedora Update System 2018-08-29 11:58:49 UTC
glibc-2.28-8.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7baa4e2d9d

Comment 3 Fedora Update System 2018-08-29 19:07:38 UTC
glibc-2.28-8.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7baa4e2d9d

Comment 4 Fedora Update System 2018-08-29 23:14:22 UTC
glibc-2.28-9.fc29 has been pushed to the Fedora 29 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-2018-7baa4e2d9d

Comment 5 Fedora Update System 2018-09-21 05:22:46 UTC
glibc-2.28-9.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Ben Cotton 2019-10-31 19:09:27 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.