Date: Fri, 13 Nov 2009 08:53:45 GMT From: Nathaniel Filardo <nwf@cs.jhu.edu> To: freebsd-gnats-submit@FreeBSD.org Subject: sparc64/140523: sparc {set, swap}context calls trash TLS register %g7 Message-ID: <200911130853.nAD8rjHV068307@www.freebsd.org> Resent-Message-ID: <200911130900.nAD907rv082826@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 140523 >Category: sparc64 >Synopsis: sparc {set,swap}context calls trash TLS register %g7 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-sparc64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 13 09:00:07 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Nathaniel Filardo >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD hydra.priv.oc.ietfng.org 9.0-CURRENT FreeBSD 9.0-CURRENT #12: Mon Oct 26 02:37:54 EDT 2009 root@hydra.priv.oc.ietfng.org:/systank/obj/systank/src/sys/NWFKERN sparc64 >Description: The FreeBSD sparc64 implementation of {set,swap}context() will trash the Thread Local Storage register (%g7), making migration of contexts across threads unsafe. This breaks plan9port, at least. The same problem existed in Linux; see http://sourceware.org/bugzilla/show_bug.cgi?id=6577 for my report there. >How-To-Repeat: Attempt to setcontext() in one pthread the result of getcontext() in another thread. Suddenly pthread_self() will return as if running on the other thread. >Fix: Don't restore %g7 from the stored context. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911130853.nAD8rjHV068307>