]> git.ipfire.org Git - thirdparty/glibc.git/commit
librt: fix NULL pointer dereference (bug 28213)
authorNikita Popov <npv1310@gmail.com>
Mon, 9 Aug 2021 14:47:34 +0000 (20:17 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 17 Aug 2021 13:16:54 +0000 (18:46 +0530)
commit27a78fd712c06748737dfa9638fab96ea362fca9
tree2d7755d17a851d0c69e0e54688c5d27401ed1449
parentb5711025bc138c0c94d90b2015d57eda404decbe
librt: fix NULL pointer dereference (bug 28213)

Helper thread frees copied attribute on NOTIFY_REMOVED message
received from the OS kernel.  Unfortunately, it fails to check whether
copied attribute actually exists (data.attr != NULL).  This worked
earlier because free() checks passed pointer before actually
attempting to release corresponding memory.  But
__pthread_attr_destroy assumes pointer is not NULL.

So passing NULL pointer to __pthread_attr_destroy will result in
segmentation fault.  This scenario is possible if
notification->sigev_notify_attributes == NULL (which means default
thread attributes should be used).

Signed-off-by: Nikita Popov <npv1310@gmail.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit b805aebd42364fe696e417808a700fdb9800c9e8)
sysdeps/unix/sysv/linux/mq_notify.c