From patchwork Wed May 13 09:45:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8702AC2D0FA for ; Wed, 13 May 2020 09:50:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6666A24933 for ; Wed, 13 May 2020 09:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363443; bh=yYXBp62M2ktB01uEgm4HAG6uzYwpAekJhxi25yXoN4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KZj5YTmwWJb56fwrfeOIsFgqKU9yhNXoX2or6h7Sz6xKx2GJogmAPKjAYDg5FcaUg KZ7CJ0RPgZPDlN5Lr0TGn+y3lGjVKKJ7Y3jW7qKUINeVgAv9mZ5uWRSnpuPh3wMU01 tb5KyxQqPvYw0Ryu9m20Q/wCdADc8zhTu0vx3fGE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732927AbgEMJum (ORCPT ); Wed, 13 May 2020 05:50:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:50722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387521AbgEMJul (ORCPT ); Wed, 13 May 2020 05:50:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F45C2312A; Wed, 13 May 2020 09:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363440; bh=yYXBp62M2ktB01uEgm4HAG6uzYwpAekJhxi25yXoN4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cRYjv4V0pHaDhB4cGstEXwKA2jTCazZCMkzo8gOEorSaPyWki7z+ArbZLmt6tx6Wq +/ZrE+6rNvIZYTXDDoLEc3rPd7UyTjFIA9BdAhTcgwqBRDhSP/IrMyJsiKz9eTIkr8 7sXa9lvGhrlAN4EUNtEjIKsBmzPJtQGQKhpKkX0M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miroslav Benes , Jann Horn , Josh Poimboeuf , Ingo Molnar , Andy Lutomirski , Dave Jones , Peter Zijlstra , Thomas Gleixner , Vince Weaver Subject: [PATCH 5.4 74/90] x86/entry/64: Fix unwind hints in rewind_stack_do_exit() Date: Wed, 13 May 2020 11:45:10 +0200 Message-Id: <20200513094417.018065219@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094408.810028856@linuxfoundation.org> References: <20200513094408.810028856@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jann Horn commit f977df7b7ca45a4ac4b66d30a8931d0434c394b1 upstream. The LEAQ instruction in rewind_stack_do_exit() moves the stack pointer directly below the pt_regs at the top of the task stack before calling do_exit(). Tell the unwinder to expect pt_regs. Fixes: 8c1f75587a18 ("x86/entry/64: Add unwind hint annotations") Reviewed-by: Miroslav Benes Signed-off-by: Jann Horn Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Dave Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vince Weaver Link: https://lore.kernel.org/r/68c33e17ae5963854916a46f522624f8e1d264f2.1587808742.git.jpoimboe@redhat.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/entry/entry_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -1740,7 +1740,7 @@ ENTRY(rewind_stack_do_exit) movq PER_CPU_VAR(cpu_current_top_of_stack), %rax leaq -PTREGS_SIZE(%rax), %rsp - UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE + UNWIND_HINT_REGS call do_exit END(rewind_stack_do_exit)