]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix race in free() of fastbin chunk: BZ #15073
authorMaxim Kuvyrkov <maxim@kugelworks.com>
Mon, 23 Dec 2013 20:44:50 +0000 (09:44 +1300)
committerMaxim Kuvyrkov <maxim@kugelworks.com>
Sun, 5 Jan 2014 02:00:40 +0000 (15:00 +1300)
commitc972bcc9ebdb5c2601b6b34001c7450e7a0b5ea3
tree86e77f0304ff216a80b86e453c76e6a3c60aae94
parent02eff8c4f82241c0843d47cb58c4355eb4f5d9e9
Fix race in free() of fastbin chunk: BZ #15073

Perform sanity check only if we have_lock.  Due to lockless nature of fastbins
we need to be careful derefencing pointers to fastbin entries (chunksize(old)
in this case) in multithreaded environments.

The fix is to add have_lock to the if-condition checks.  The rest of the patch
only makes code more readable.

* malloc/malloc.c (_int_free): Perform sanity check only if we
have_lock.

Conflicts:

ChangeLog
NEWS
ChangeLog
NEWS
malloc/malloc.c