Bug 17126 - gcc (libstdc++) new security issue CVE-2015-5276
Summary: gcc (libstdc++) new security issue CVE-2015-5276
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 5
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL: http://lwn.net/Vulnerabilities/665238/
Whiteboard: has_procedure advisory mga5-32-ok MGA...
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2015-11-11 16:40 CET by David Walser
Modified: 2015-11-20 18:11 CET (History)
5 users (show)

See Also:
Source RPM: gcc-4.9.2-4.mga5.src.rpm
CVE:
Status comment:


Attachments
Test file for C++ (712 bytes, text/plain)
2015-11-18 19:45 CET, Len Lawrence
Details

Description David Walser 2015-11-11 16:40:46 CET
OpenSuSE has issued an advisory on November 10:
http://lists.opensuse.org/opensuse-updates/2015-11/msg00054.html

The issue is fixed upstream in 4.9.4 and 5.3, and in commits linked from the upstream bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65142

Reproducible: 

Steps to Reproduce:
Comment 1 Thomas Backlund 2015-11-11 22:34:45 CET
SRPM:
gcc-4.9.2-4.1.mga5.src.rpm


i586:
gcc-4.9.2-4.1.mga5.i586.rpm
gcc-c++-4.9.2-4.1.mga5.i586.rpm
gcc-cpp-4.9.2-4.1.mga5.i586.rpm
gcc-doc-4.9.2-4.1.mga5.noarch.rpm
gcc-doc-pdf-4.9.2-4.1.mga5.noarch.rpm
gcc-gfortran-4.9.2-4.1.mga5.i586.rpm
gcc-gnat-4.9.2-4.1.mga5.i586.rpm
gcc-java-4.9.2-4.1.mga5.i586.rpm
gcc-objc-4.9.2-4.1.mga5.i586.rpm
gcc-objc++-4.9.2-4.1.mga5.i586.rpm
gcc-plugins-4.9.2-4.1.mga5.i586.rpm
gcj-tools-4.9.2-4.1.mga5.i586.rpm
libasan1-4.9.2-4.1.mga5.i586.rpm
libasan-devel-4.9.2-4.1.mga5.i586.rpm
libatomic1-4.9.2-4.1.mga5.i586.rpm
libatomic-devel-4.9.2-4.1.mga5.i586.rpm
libcilkrts5-4.9.2-4.1.mga5.i586.rpm
libcilkrts-devel-4.9.2-4.1.mga5.i586.rpm
libgcc1-4.9.2-4.1.mga5.i586.rpm
libgcj15-4.9.2-4.1.mga5.i586.rpm
libgcj15-base-4.9.2-4.1.mga5.i586.rpm
libgcj15-src-4.9.2-4.1.mga5.i586.rpm
libgcj_bc1-4.9.2-4.1.mga5.i586.rpm
libgcj-devel-4.9.2-4.1.mga5.i586.rpm
libgcj-static-devel-4.9.2-4.1.mga5.i586.rpm
libgfortran3-4.9.2-4.1.mga5.i586.rpm
libgnat1-4.9.2-4.1.mga5.i586.rpm
libgomp1-4.9.2-4.1.mga5.i586.rpm
libgomp-devel-4.9.2-4.1.mga5.i586.rpm
libitm1-4.9.2-4.1.mga5.i586.rpm
libitm-devel-4.9.2-4.1.mga5.i586.rpm
libobjc4-4.9.2-4.1.mga5.i586.rpm
libquadmath0-4.9.2-4.1.mga5.i586.rpm
libquadmath-devel-4.9.2-4.1.mga5.i586.rpm
libstdc++6-4.9.2-4.1.mga5.i586.rpm
libstdc++-devel-4.9.2-4.1.mga5.i586.rpm
libstdc++-docs-4.9.2-4.1.mga5.noarch.rpm
libstdc++-static-devel-4.9.2-4.1.mga5.i586.rpm
libubsan0-4.9.2-4.1.mga5.i586.rpm
libubsan-devel-4.9.2-4.1.mga5.i586.rpm
libvtv0-4.9.2-4.1.mga5.i586.rpm
libvtv-devel-4.9.2-4.1.mga5.i586.rpm


x86_64
gcc-4.9.2-4.1.mga5.x86_64.rpm
gcc-c++-4.9.2-4.1.mga5.x86_64.rpm
gcc-cpp-4.9.2-4.1.mga5.x86_64.rpm
gcc-doc-4.9.2-4.1.mga5.noarch.rpm
gcc-doc-pdf-4.9.2-4.1.mga5.noarch.rpm
gcc-gfortran-4.9.2-4.1.mga5.x86_64.rpm
gcc-gnat-4.9.2-4.1.mga5.x86_64.rpm
gcc-java-4.9.2-4.1.mga5.x86_64.rpm
gcc-objc-4.9.2-4.1.mga5.x86_64.rpm
gcc-objc++-4.9.2-4.1.mga5.x86_64.rpm
gcc-plugins-4.9.2-4.1.mga5.x86_64.rpm
gcj-tools-4.9.2-4.1.mga5.x86_64.rpm
lib64gcj15-4.9.2-4.1.mga5.x86_64.rpm
lib64gcj_bc1-4.9.2-4.1.mga5.x86_64.rpm
lib64gcj-devel-4.9.2-4.1.mga5.x86_64.rpm
lib64gcj-static-devel-4.9.2-4.1.mga5.x86_64.rpm
libasan1-4.9.2-4.1.mga5.x86_64.rpm
libasan-devel-4.9.2-4.1.mga5.x86_64.rpm
libatomic1-4.9.2-4.1.mga5.x86_64.rpm
libatomic-devel-4.9.2-4.1.mga5.x86_64.rpm
libcilkrts5-4.9.2-4.1.mga5.x86_64.rpm
libcilkrts-devel-4.9.2-4.1.mga5.x86_64.rpm
libgcc1-4.9.2-4.1.mga5.x86_64.rpm
libgcj15-base-4.9.2-4.1.mga5.x86_64.rpm
libgcj15-src-4.9.2-4.1.mga5.x86_64.rpm
libgfortran3-4.9.2-4.1.mga5.x86_64.rpm
libgnat1-4.9.2-4.1.mga5.x86_64.rpm
libgomp1-4.9.2-4.1.mga5.x86_64.rpm
libgomp-devel-4.9.2-4.1.mga5.x86_64.rpm
libitm1-4.9.2-4.1.mga5.x86_64.rpm
libitm-devel-4.9.2-4.1.mga5.x86_64.rpm
liblsan0-4.9.2-4.1.mga5.x86_64.rpm
liblsan-devel-4.9.2-4.1.mga5.x86_64.rpm
libobjc4-4.9.2-4.1.mga5.x86_64.rpm
libquadmath0-4.9.2-4.1.mga5.x86_64.rpm
libquadmath-devel-4.9.2-4.1.mga5.x86_64.rpm
libstdc++6-4.9.2-4.1.mga5.x86_64.rpm
libstdc++-devel-4.9.2-4.1.mga5.x86_64.rpm
libstdc++-docs-4.9.2-4.1.mga5.noarch.rpm
libstdc++-static-devel-4.9.2-4.1.mga5.x86_64.rpm
libtsan0-4.9.2-4.1.mga5.x86_64.rpm
libtsan-devel-4.9.2-4.1.mga5.x86_64.rpm
libubsan0-4.9.2-4.1.mga5.x86_64.rpm
libubsan-devel-4.9.2-4.1.mga5.x86_64.rpm
libvtv0-4.9.2-4.1.mga5.x86_64.rpm
libvtv-devel-4.9.2-4.1.mga5.x86_64.rpm

Assignee: tmb => qa-bugs

Comment 2 Thomas Backlund 2015-11-11 22:41:13 CET
advisory (also added to svn)

  It was discovered that the std::random_device class in libstdc++ would
  not properly detect short reads and could return return predictable
  values if applications used it to obtain randomness from a blocking
  source such as /dev/random. ( CVE-2015-5276)
references:
 - https://bugs.mageia.org/show_bug.cgi?id=17126
 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65142
 - http://lists.opensuse.org/opensuse-updates/2015-11/msg00054.html

CC: (none) => tmb
Hardware: i586 => All
Whiteboard: (none) => advisory

Comment 3 Len Lawrence 2015-11-13 16:09:17 CET
mga5  x86_64  Mate

Installed as many of the packages as possible before updating.  Many were already in place.  After cherry-picking from the update list 38 packages installed on my Aorus X5.  There should have been more so I need to go back and run a detailed check.

After that it would be useful to find a test suite to exercise the compilers and something in particular to check random_device in C++.

Looks like a long haul.

CC: (none) => tarazed25

Comment 4 Len Lawrence 2015-11-13 17:19:20 CET
kernel-linus-4.1.12-1.mga5  x86_64  Mate
All 46 packages installed without incident on another laptop.
Comment 5 Len Lawrence 2015-11-13 17:31:35 CET
Some information on testing at https://gcc.gnu.org/install/test.html.
tcl and expect are already installed here and Mageia supports DejaGnu; just installed that as well.
Comment 6 Thomas Andrews 2015-11-14 00:26:27 CET
Installed on a Dell Dimension E310, P4 processor, Intel graphics, on bothe 64-bit and 32-bit Mageia 5 installs. Installed at the same time with packages from Bug #17065 and Bug #17129.

Only testing done was to install the relevant packages presented by Mageia Update, reboot, and determine if the system still functions normally.

No issues apparent on either install

CC: (none) => andrewsfarm

Comment 7 Len Lawrence 2015-11-14 02:04:58 CET
@Thomas comment 6
I installed the Bug #17129 update earlier.  No issues either.  Kernel upgrades probably exercise some parts of the compiler collection (dkms and all that) so this level of testing may be adequate.  For my own satisfaction I shall probably try to get the testing suite working, even after the update is pushed.
Comment 8 Thomas Andrews 2015-11-14 02:29:24 CET
Homemade computer, ASRock motherboard, Athlon X2 7750 processor, 8GB RAM, on-board ATI graphics.

Installed on both 64-bit and 32-bit systems, as described in Comment 6.

No issues in either install.
Comment 9 Herman Viaene 2015-11-17 16:47:56 CET
MGA5-32 on Acer D620 Xfce
No installation issues.
I wanted to run testsuite as per Comment 5 , but it appears to me that the testsuites are not included in our packages, is that correct. I don't feel ready to compile the gcc from scratch as the tar file has the testsuites in there.

CC: (none) => herman.viaene

Comment 10 Len Lawrence 2015-11-17 16:51:40 CET
I am pretty sure that the test suite is not included in Mageia.  I have downloaded the tar file but real life keeps interfering so have had no time to see if it can be used.
Comment 11 claire robinson 2015-11-17 18:08:50 CET
Can be tested basically with the example code here:
http://en.cppreference.com/w/cpp/numeric/random/random_device
Comment 12 claire robinson 2015-11-17 18:12:53 CET
Before
------
Saved the code as random.cpp

It moans without the -std=c++11 switch but luckily tells you to add it \o/

$ g++ -std=c++11 -o random random.cpp 

$ ls
random*  random.cpp

$ ./random 
0 : *******************
1 : *******************
2 : *******************
3 : *******************
4 : *******************
5 : ********************
6 : *******************
7 : ********************
8 : ********************
9 : ********************
Comment 13 claire robinson 2015-11-17 18:54:54 CET
After
-----

$ g++ -std=c++11 -o random-after random.cpp 

$ ./random-after
0 : ********************
1 : *******************
2 : *******************
3 : ********************
4 : ********************
5 : ********************
6 : ********************
7 : ********************
8 : *******************
9 : *******************

Testing complete mga5 32

Whiteboard: advisory => has_procedure advisory mga5-32-ok

Comment 14 Len Lawrence 2015-11-18 19:38:19 CET
mga5  x86_64  Mate
Used Claire's snippet to test.
Before update:
$ g++ -std=c++11 -o random0 random.cc
$ ./random0
0 : ********************
1 : ******************
2 : ********************
3 : ********************
4 : ********************
5 : *******************
6 : *******************
7 : ********************
8 : ********************
9 : ********************
Afterwards:
$ g++ -std=c++11 -o random1 random.cc
$ ./random1
0 : ********************
1 : *******************
2 : *******************
3 : ********************
4 : *******************
5 : *******************
6 : ********************
7 : *******************
8 : ********************
9 : *******************

Testing complete for 64-bits.
Len Lawrence 2015-11-18 19:39:03 CET

Whiteboard: has_procedure advisory mga5-32-ok => has_procedure advisory mga5-32-ok MGA5-64-OK

Comment 15 Len Lawrence 2015-11-18 19:45:56 CET
Created attachment 7212 [details]
Test file for C++

This provides a partial test of the compiler collection and outputs a binary file which should generate a random text pattern.
$ g++ -std=c++11 -o random-after random.cc
e.g.
$ ./random-after
0 : ********************
1 : *******************
2 : *******************
3 : ********************
4 : *******************
5 : *******************
6 : ********************
7 : *******************
8 : ********************
9 : *******************
Len Lawrence 2015-11-18 19:46:37 CET

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Comment 16 Mageia Robot 2015-11-19 23:09:14 CET
An update for this issue has been pushed to Mageia Updates repository.

http://advisories.mageia.org/MGASA-2015-0449.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED

David Walser 2015-11-20 18:11:38 CET

URL: (none) => http://lwn.net/Vulnerabilities/665238/


Note You need to log in before you can comment on or make changes to this bug.