mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 06:20:06 +00:00
Properly handle forced elision in pthread_mutex_trylock (bug 16657)
This commit is contained in:
parent
da5bcaa499
commit
b0a3c1640a
@ -1,5 +1,13 @@
|
||||
2014-12-11 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
[BZ #16657]
|
||||
* nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock): Use
|
||||
FORCE_ELISION instead of DO_ELISION.
|
||||
* sysdeps/unix/sysv/linux/x86/force-elision.h (DO_ELISION):
|
||||
Remove.
|
||||
* sysdeps/unix/sysv/linux/s390/force-elision.h (DO_ELISION):
|
||||
Likewise.
|
||||
|
||||
* iconvdata/gconv-modules: Remove duplicate entry.
|
||||
|
||||
2014-12-11 Will Newton <will.newton@linaro.org>
|
||||
|
10
NEWS
10
NEWS
@ -10,11 +10,11 @@ Version 2.21
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
6652, 10672, 12847, 12926, 13862, 14132, 14138, 14171, 14498, 15215,
|
||||
15884, 16469, 16619, 16740, 16857, 17192, 17266, 17344, 17363, 17370,
|
||||
17371, 17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522, 17555,
|
||||
17570, 17571, 17572, 17573, 17574, 17581, 17582, 17583, 17584, 17585,
|
||||
17589, 17594, 17601, 17608, 17616, 17625, 17633, 17634, 17647, 17653,
|
||||
17664, 17665, 17668, 17682.
|
||||
15884, 16469, 16619, 16657, 16740, 16857, 17192, 17266, 17344, 17363,
|
||||
17370, 17371, 17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522,
|
||||
17555, 17570, 17571, 17572, 17573, 17574, 17581, 17582, 17583, 17584,
|
||||
17585, 17589, 17594, 17601, 17608, 17616, 17625, 17633, 17634, 17647,
|
||||
17653, 17664, 17665, 17668, 17682.
|
||||
|
||||
* CVE-2104-7817 The wordexp function could ignore the WRDE_NOCMD flag
|
||||
under certain input conditions resulting in the execution of a shell for
|
||||
|
@ -26,8 +26,8 @@
|
||||
#define lll_trylock_elision(a,t) lll_trylock(a)
|
||||
#endif
|
||||
|
||||
#ifndef DO_ELISION
|
||||
#define DO_ELISION(m) 0
|
||||
#ifndef FORCE_ELISION
|
||||
#define FORCE_ELISION(m, s)
|
||||
#endif
|
||||
|
||||
/* We don't force elision in trylock, because this can lead to inconsistent
|
||||
@ -69,7 +69,7 @@ __pthread_mutex_trylock (mutex)
|
||||
break;
|
||||
|
||||
case PTHREAD_MUTEX_TIMED_ELISION_NP:
|
||||
elision:
|
||||
elision: __attribute__((unused))
|
||||
if (lll_trylock_elision (mutex->__data.__lock,
|
||||
mutex->__data.__elision) != 0)
|
||||
break;
|
||||
@ -77,8 +77,7 @@ __pthread_mutex_trylock (mutex)
|
||||
return 0;
|
||||
|
||||
case PTHREAD_MUTEX_TIMED_NP:
|
||||
if (DO_ELISION (mutex))
|
||||
goto elision;
|
||||
FORCE_ELISION (mutex, goto elision);
|
||||
/*FALL THROUGH*/
|
||||
case PTHREAD_MUTEX_ADAPTIVE_NP:
|
||||
case PTHREAD_MUTEX_ERRORCHECK_NP:
|
||||
|
@ -17,11 +17,6 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef ENABLE_LOCK_ELISION
|
||||
/* Check for elision on this lock without upgrading. */
|
||||
#define DO_ELISION(m) \
|
||||
(__pthread_force_elision \
|
||||
&& (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0) \
|
||||
|
||||
/* Automatically enable elision for existing user lock kinds. */
|
||||
#define FORCE_ELISION(m, s) \
|
||||
if (__pthread_force_elision \
|
||||
|
@ -16,11 +16,6 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Check for elision on this lock without upgrading. */
|
||||
#define DO_ELISION(m) \
|
||||
(__pthread_force_elision \
|
||||
&& (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0) \
|
||||
|
||||
/* Automatically enable elision for existing user lock kinds. */
|
||||
#define FORCE_ELISION(m, s) \
|
||||
if (__pthread_force_elision \
|
||||
|
Loading…
Reference in New Issue
Block a user