Avoid access beyond memory bounds in pthread_attr_getaffinity_np
commit5865a56bf4e31c5a152e46454367a99c5971ac02
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 13 Jun 2013 19:50:06 +0000 (14 01:20 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 13 Jun 2013 19:50:06 +0000 (14 01:20 +0530)
tree0a0ee5d430ef178bced7a0718e62427cd1da6b1b
parentc204ab284bc3ef492f5a5201bd6131032bfd471a
Avoid access beyond memory bounds in pthread_attr_getaffinity_np

Resolves BZ #15618.

pthread_attr_getaffinity_np may write beyond bounds of the input
cpuset buffer if the size of the input buffer is smaller than the
buffer present in the input pthread attributes.  Fix is to copy to the
extent of the minimum of the source and the destination.
NEWS
nptl/ChangeLog
nptl/Makefile
nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
nptl/tst-pthread-attr-affinity.c [new file with mode: 0644]