From mboxrd@z Thu Jan 1 00:00:00 1970 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,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 E9689C2D0F9 for ; Wed, 13 May 2020 09:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCAB920769 for ; Wed, 13 May 2020 09:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363243; bh=E0ajzK3FFgn7QwyMlwaqJladPNtV72sfcfKhPvhCaZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hazbOVSl1fMfpLDGdj+uZ8OwVmH+iOUum6S4S9CsX6KGA4xNpp8w/YEhQARU8uKI7 s0amzJBz2dZFJs+KUO+4VSgmoigr2ILoZXVvDHhyaXD1odmxiGTbgWavvoFNoyKa/h C3p+H1pz2IhYNkhsaNGdAShDx3YFS1Y0tQoszS2s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732846AbgEMJrX (ORCPT ); Wed, 13 May 2020 05:47:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:45014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732818AbgEMJrQ (ORCPT ); Wed, 13 May 2020 05:47:16 -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 AD11320769; Wed, 13 May 2020 09:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589363235; bh=E0ajzK3FFgn7QwyMlwaqJladPNtV72sfcfKhPvhCaZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KO5Q4biOOrV+vHRKCv1U6n53BE8pgIY/hc201MCdrTUsBirw5Gj5sHfPIw+dKq3Pi IPah+YPsxs6UOCsxevT5jvhgmdw6QuSPqhKWv3tkSbZkdYky/mTRDVZ1cJFoVlPxxL T7GDQvv1VAXOieFCbTxfKhemLNDg8yiB+fis920U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miroslav Benes , Josh Poimboeuf , Ingo Molnar , Andy Lutomirski , Dave Jones , Jann Horn , Peter Zijlstra , Thomas Gleixner , Vince Weaver Subject: [PATCH 4.19 40/48] x86/unwind/orc: Dont skip the first frame for inactive tasks Date: Wed, 13 May 2020 11:45:06 +0200 Message-Id: <20200513094402.388397680@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513094351.100352960@linuxfoundation.org> References: <20200513094351.100352960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miroslav Benes commit f1d9a2abff66aa8156fbc1493abed468db63ea48 upstream. When unwinding an inactive task, the ORC unwinder skips the first frame by default. If both the 'regs' and 'first_frame' parameters of unwind_start() are NULL, 'state->sp' and 'first_frame' are later initialized to the same value for an inactive task. Given there is a "less than or equal to" comparison used at the end of __unwind_start() for skipping stack frames, the first frame is skipped. Drop the equal part of the comparison and make the behavior equivalent to the frame pointer unwinder. Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder") Reviewed-by: Miroslav Benes Signed-off-by: Miroslav Benes Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Dave Jones Cc: Jann Horn Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vince Weaver Link: https://lore.kernel.org/r/7f08db872ab59e807016910acdbe82f744de7065.1587808742.git.jpoimboe@redhat.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/unwind_orc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -629,7 +629,7 @@ void __unwind_start(struct unwind_state /* Otherwise, skip ahead to the user-specified starting frame: */ while (!unwind_done(state) && (!on_stack(&state->stack_info, first_frame, sizeof(long)) || - state->sp <= (unsigned long)first_frame)) + state->sp < (unsigned long)first_frame)) unwind_next_frame(state); return;