overhaul SSP support to use a real canary
[musl] / src / thread / pthread_create.c
index 0e1dbb2..c3b65ae 100644 (file)
@@ -120,6 +120,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo
        new->tsd = (void *)tsd;
        if (attr) new->detached = attr->_a_detach;
        new->unblock_cancel = self->cancel;
        new->tsd = (void *)tsd;
        if (attr) new->detached = attr->_a_detach;
        new->unblock_cancel = self->cancel;
+       new->canary = self->canary ^ (uintptr_t)&new;
        stack = (void *)new;
 
        __synccall_lock();
        stack = (void *)new;
 
        __synccall_lock();