From patchwork Mon Dec 18 18:08:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 24992 Received: (qmail 129853 invoked by alias); 18 Dec 2017 18:08:39 -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 129724 invoked by uid 89); 18 Dec 2017 18:08:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=you! X-HELO: mail-wm0-f48.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=HYcmnhZKxH0QuX0Utka183tJFHaIDw8Z0QfhJLE9+10=; b=rTvrINMHTAM7evoXL5bH1HygB357vNTM133zCTNbV4v5jAbQQpPIqTAYY8evvE0GZO dIfTxDRcB/iMs9MRlBkCAzSp/K017nb+1YZQqxTCHWL7GgSG9z82OnlitOX+tUlmmpFG G4yJ1bHZtvfV4O5SEPLaGvMP0PPdYdTe5Hg1SfUMQIipwONWKPkZg1vBzYzv2cJGMJjf 0nmnxlWyMYgtTug4vXGPEND03Zq7SR1CBT9NHZsa0oCLqP1WBMi5m2K+ChXuhaYzevMn fqtPAXOgGBNCGtPSGHrRNOSYTMMgIB27pVzpwBWnl3Q5vC983hFHvfgjMHh+gbzu0T3S 4RrQ== X-Gm-Message-State: AKGB3mLxuh8SzK0SecpqBC8Qb4/a7tP7bVwtq1hAUnmhENNOi0uxHo52 o+EmZLU4PO5ADuwKDg1wM8Rdqw== X-Google-Smtp-Source: ACJfBouBrB+ZyfkX9zUIaPaseuhK7aiSfgy8TlE3f7SVXYfD3CtAoELsYfBszcqo7yE6rahMUoLtww== X-Received: by 10.28.222.132 with SMTP id v126mr622941wmg.127.1513620515047; Mon, 18 Dec 2017 10:08:35 -0800 (PST) Date: Mon, 18 Dec 2017 18:08:29 +0000 From: Sergei Trofimovich To: Joseph Myers Cc: , Sergei Trofimovich Subject: Re: [PATCH] mips64: fix clobbering s0 in setjmp() [BZ #22624] Message-ID: <20171218180829.795db346@sf> In-Reply-To: References: <20171217100144.27689-1-slyich@gmail.com> MIME-Version: 1.0 On Mon, 18 Dec 2017 17:24:03 +0000 Joseph Myers wrote: > Thanks, committed. Thank you! I've also noticed that mips32 has exactly the same problem as it copies the same code. Attached patch. From bbfc828f8f8404b2d5f37f59a3186e4fc4d278a4 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 17 Dec 2017 09:51:34 +0000 Subject: [PATCH] mips32: fix clobbering s0 in setjmp() [BZ #22624] Similar to commit 1ab47db00dfbc0128119e3503d3ed640ffc4830b ("mips64: fix clobbering s0 in setjmp() [BZ #22624]") as sysdeps/mips/setjmp_aux.c is almost an identical copy of sysdeps/mips/mips64/setjmp_aux.c. Signed-off-by: Sergei Trofimovich --- sysdeps/mips/setjmp_aux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/mips/setjmp_aux.c b/sysdeps/mips/setjmp_aux.c index 0052e0c4a4..176243bc51 100644 --- a/sysdeps/mips/setjmp_aux.c +++ b/sysdeps/mips/setjmp_aux.c @@ -23,7 +23,12 @@ pointer. We do things this way because it's difficult to reliably access them in C. */ +/* Stack protection is disabled to avoid changing s0 (or any other + caller-save register) before storing it to environment. + See BZ #22624. */ + int __attribute__ ((nomips16)) +inhibit_stack_protector __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) { #ifdef __mips_hard_float -- 2.15.1