[PATCH] [ping] nptl: Fix abort in case of set*id failure

Florian Weimer fweimer@redhat.com
Wed Jul 2 12:18:00 GMT 2014


If a call to the set*id functions fails in a multi-threaded program,
the abort introduced in commit 13f7fe35ae2b0ea55dc4b9628763aafdc8bdc30c
was triggered.

We address by checking that all calls to set*id on all threads give
the same result, and only abort if we see success followed by failure
(or vice versa).

2014-07-02  Florian Weimer  <fweimer@redhat.com>

	* nptl/pthreadP.h (__nptl_setxid_error): Declare function.
	* nptl/allocatestack.c (__nptl_setxid_error): New function.
	(__nptl_setxid): Initialize error member.  Call
	__nptl_setxid_error.
	* nptl/nptl-init.c (sighandler_setxid): Call __nptl_setxid_error.
	* nptl/descr.h (struct xid_command): Add error member.
	* nptl/tst-setuid3.c: New file.
	* nptl/Makefile (tests): Add it.

-- 
Florian Weimer / Red Hat Product Security
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setxid-fix.patch
Type: text/x-patch
Size: 6876 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140702/d178bf41/attachment.bin>


More information about the Libc-alpha mailing list