Blame SOURCES/glibc-rh1322544.patch

147e83
commit 217a74a85cdd60df236c296ad88142b78d35eccf
147e83
Author: Andreas Schwab <schwab@suse.de>
147e83
Date:   Mon Dec 8 15:13:38 2014 +0100
147e83
147e83
    Don't touch user-controlled stdio locks in forked child (bug 12847)
147e83
    
147e83
    The stdio locks for streams with the _IO_USER_LOCK flag should not be
147e83
    touched by internal code.
147e83
147e83
--- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/fork.c
147e83
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/fork.c
147e83
@@ -45,7 +45,8 @@
147e83
   _IO_ITER i;
147e83
 
147e83
   for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
147e83
-    _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
147e83
+    if ((_IO_iter_file (i)->_flags & _IO_USER_LOCK) == 0)
147e83
+      _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
147e83
 }
147e83
 
147e83