From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10527 Path: news.gmane.org!.POSTED!not-for-mail From: "LeMay, Michael" Newsgroups: gmane.linux.lib.musl.general Subject: [RFC PATCH 4/7] add stack segment override prefix to i386 __clone Date: Tue, 27 Sep 2016 15:36:52 -0700 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1475015834 12446 195.159.176.226 (27 Sep 2016 22:37:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Sep 2016 22:37:14 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 To: "musl@lists.openwall.com" Original-X-From: musl-return-10540-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 28 00:37:11 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bp0zq-00029j-2g for gllmg-musl@m.gmane.org; Wed, 28 Sep 2016 00:37:06 +0200 Original-Received: (qmail 3186 invoked by uid 550); 27 Sep 2016 22:37:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3143 invoked from network); 27 Sep 2016 22:37:04 -0000 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,407,1470726000"; d="scan'208";a="14389696" Xref: news.gmane.org gmane.linux.lib.musl.general:10527 Archived-At: When segmentation-hardened SafeStack is enabled, it defines a limit for DS and ES that is below all of the safe stacks. The i386 __clone implementation is written in assembly language, so the compiler is unable to automatically add a stack segment override prefix to an instruction in that routine that accesses a safe stack. This patch adds that prefix to the source code. Signed-off-by: Michael LeMay --- src/thread/i386/clone.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread/i386/clone.s b/src/thread/i386/clone.s index 52fe7ef..e11372d 100644 --- a/src/thread/i386/clone.s +++ b/src/thread/i386/clone.s @@ -22,7 +22,7 @@ __clone: and $-16,%ecx sub $16,%ecx mov 20(%ebp),%edi - mov %edi,(%ecx) + mov %edi,%ss:(%ecx) mov 24(%ebp),%edx mov %esp,%esi mov 32(%ebp),%edi -- 2.7.4