aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-02 03:30:55 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-02 03:30:55 -0700
commit6cbbaa50aac809ad6e0692247876c82d58e466bf (patch)
treecaf0a957162147dc92d24933de3b61f6cf40c838
parent2fd0cd8b5257e7ae0c0df0651ee62a6ef7c37cc2 (diff)
downloadglibc-6cbbaa50aac809ad6e0692247876c82d58e466bf.tar
glibc-6cbbaa50aac809ad6e0692247876c82d58e466bf.tar.gz
glibc-6cbbaa50aac809ad6e0692247876c82d58e466bf.tar.bz2
glibc-6cbbaa50aac809ad6e0692247876c82d58e466bf.zip
Fix possible race when freeing object in fast bin list.
-rw-r--r--ChangeLog5
-rw-r--r--malloc/malloc.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c6c36f472..4700e7d7b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-02 Ulrich Drepper <drepper@redhat.com>
+
+ * malloc/malloc.c [ATOMIC_FASTBINS] (_int_free): Add full barrier when
+ adding to fast bin list.
+
2009-07-01 Ulrich Drepper <drepper@redhat.com>
* nis/nss_nis/nis-network.c (_nss_nis_getnetbyaddr_r): Don't use
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 516d401991..70e4e58845 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4822,6 +4822,7 @@ _int_free(mstate av, mchunkptr p)
goto errout;
}
p->fd = fd = old;
+ atomic_full_barrier ();
}
while ((old = catomic_compare_and_exchange_val_acq (fb, p, fd)) != fd);
#else