|
Message-ID: <1407257494.24324.241.camel@eris.loria.fr> Date: Tue, 05 Aug 2014 18:51:34 +0200 From: Jens Gustedt <jens.gustedt@...ia.fr> To: musl@...ts.openwall.com Subject: PATCH: don't call cleanup handlers after a regular return from the thread start function Don't call cleanup handlers after a regular return from the thread start function The chained list of cleanup handler function uses list items that are local to the respective function of a cleanup block. In case of a return out of the middle of a cleanup block, using these list items can lead to UB. POSIX lists three different cases in which a cleanup handler that is established on the cleanup stack has to be executed. Regular return from the thread start function is not among these cases. Linux manpages are more explicit and state: Clean-up handlers are not called if the thread terminates by performing a return from the thread start function. This patch aligns musl to that behavior. -- :: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: View attachment "cleanup-push-fix.patch" of type "text/x-patch" (859 bytes) Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.