From patchwork Sun Feb 10 23:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 1039501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-99903-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gentoo.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="cB6MHRfI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43yQ9y4s9mz9sDr for ; Mon, 11 Feb 2019 10:29:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=wG8 qVwhPa5sAsvou1lGP2+ez9b4tj5Vd9DNTj31JdnP/svSyyUC1nj8fBIIuLuVOhUE rnMKw/j7STno1vePFTV1B8AG32+FA/gELoRHKvBwsOAi/Ydf5fzR2xD3aEzUw3c0 j+g2n4OQCEaFFL4JVrNmSJAjYFcdTJcXdBGji5+w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=PdWPxUzpK efbMOjWcmcflubW7+s=; b=cB6MHRfIfbfDEgFzQcD//687s0HrrvELNOxV0eYbq zjzQZ/oEXhq1FOzCeEISFbEQt1C5Rwpj2xgWL/KXO5fj5WjelLfSA+hdEUPSzHU3 IQbTorGOjdzoSyKQIVCNqtvffbZx8gTHjpjGIByGII3HNZAqm0ZqHCg/EtZjv6p8 +E= Received: (qmail 46266 invoked by alias); 10 Feb 2019 23:29:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 46257 invoked by uid 89); 10 Feb 2019 23:29:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=James, Hx-languages-length:1294, Myers, myers X-HELO: smtp.gentoo.org From: Sergei Trofimovich To: libc-alpha@sourceware.org Cc: Andreas Schwab , Sergei Trofimovich , James Le Cuirot , Andreas Schwab Subject: [PATCH] m68k: fix clobbering a5 in setjmp() [BZ #24202] Date: Sun, 10 Feb 2019 23:29:10 +0000 Message-Id: <20190210232910.22652-1-slyfox@gentoo.org> MIME-Version: 1.0 setjmp() uses C code to store current registers into jmp_buf environment. -fstack-protector-all places canary into setjmp() prologue and clobbers 'a5' before it gets saved. The change inhibits stack canary injection to avoid clobber. [BZ #24202] * sysdeps/m68k/setjmp.c (*setjmp): Use inhibit_stack_protector. CC: James Le Cuirot CC: Andreas Schwab Signed-off-by: Sergei Trofimovich --- ChangeLog | 6 ++++++ sysdeps/m68k/setjmp.c | 1 + 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index c143073ca7..c1e8dd9c3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-02-10 Sergei Trofimovich + + [BZ #24202] + * sysdeps/m68k/setjmp.c (*setjmp): Use + inhibit_stack_protector. + 2019-02-06 Joseph Myers * elf/dl-load.h (_dl_postprocess_loadcmd): Use __always_inline diff --git a/sysdeps/m68k/setjmp.c b/sysdeps/m68k/setjmp.c index 39ab7178a0..62bd281119 100644 --- a/sysdeps/m68k/setjmp.c +++ b/sysdeps/m68k/setjmp.c @@ -19,6 +19,7 @@ /* Save the current program position in ENV and return 0. */ int +inhibit_stack_protector #if defined BSD_SETJMP # undef setjmp # define savemask 1