From patchwork Sun May 28 07:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 99887 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp825299vqr; Sun, 28 May 2023 01:41:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7XZ3CPmI7AJtAjjhy462nahKjog4tvmpyICEjZl6s94tSpaq5w67Rzo3e/BspF8aFXPM1x X-Received: by 2002:a17:902:e54e:b0:1ac:6fc3:6beb with SMTP id n14-20020a170902e54e00b001ac6fc36bebmr6255055plf.9.1685263274901; Sun, 28 May 2023 01:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685263274; cv=none; d=google.com; s=arc-20160816; b=yYZOqBRnXDIlPIfxogk5uDBu2K59t78mJBCVHy97058TwiWHzf2z5k3QS3SoUKevEa zgbhLC/2H/qqeIdQx3ZJ3SN99kwqWHSw9WqvIj1Ybq4mga4+JuEk4fu/t9WRWZCrjiwf bVGFS2SQScP7JA7YF8zC03dSIbJGlLL1sruvM7zaIJyg4A6YRLXiobn21mHm4vqatFah 083lUENTk+B4VrpM2VscLSC7XYf21TdnQojAE5PdFSkl5d5aotOldyNt2E8fOrjvbiSB AQmml2gfkmg2Wcs+WLuFIu0dl3BOQhQggE/5aTGokEXEbxjbQVjeYdr2aSW3Ano+qh8j 8tiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:content-transfer-encoding :message-id:references:subject:cc:to:dkim-signature:dkim-signature :from; bh=qlUJpstUp8GkAxNo3SCZ1B+h0hwX5UKSIsVt7FBPBlA=; b=o7Zh41Lzv0ZflKe/F5s7nKQbTtG+Q5UXdpVThibTjgG2U2XV0kdLV2cPJbhNr6HMZV VzF3rhiigtDWVr08lERl/+LJqblCeC2Yc27BcKZW3BjQ6qX9fPkGQl/bA1DKVxueAV48 ODERTFLeOj91lZJFlt5uFXyueRrWM+N44g7hPVM2S9n6o1ohy8mgECbE/rWrLCgojwhF Ut0AP6xAwwO6EA4cwfq8Oz+dQz6yxbz0HSvJZ7XsottWW+1Lf0NDqALqnMaeXRZj/5kq rGY0rJYxh8Ex9ETAa4879yDdw1ct+iWAUbae1AEV5nf8/ViMBccpLiaX15xA1QRzFYs3 zVOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gs94pY1j; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a170902ecc500b001a531f29044si8525066plh.521.2023.05.28.01.41.02; Sun, 28 May 2023 01:41:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gs94pY1j; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbjE1HxF (ORCPT + 99 others); Sun, 28 May 2023 03:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjE1HxC (ORCPT ); Sun, 28 May 2023 03:53:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A99DE for ; Sun, 28 May 2023 00:53:01 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685260379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=qlUJpstUp8GkAxNo3SCZ1B+h0hwX5UKSIsVt7FBPBlA=; b=gs94pY1jwBtUe9l/A8VtGMSo2Bs6oA7yoJb28bSVe3/ohtdFAnYCqLFnf9dL9H5dwcxPuT hFMLmtCOlRX6yWDHzqj83eJJGixTkkcIK1fJzQeNFnPHVnlR6EKKUJOneB9YwC4SYxAz3u beVv2/dZTaAGr3fHozhrs0SNKNr6QjLPbRGMDJoKHCVsvi5ZznCaFZvxYJpxzE3goS7oZq 3tbBCtOvKcsyVWrC9hh/qazhIA6W3YEc+MX7iZIuqNUqfXoqxNmxRAR5Cdpe1la9NjyDFR d5z/gOb+azNVuiZM0sAw7Gr72/DSiSgvvTSkgBEpKfJVoyJTMYpSt7LIO/8/cA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685260379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=qlUJpstUp8GkAxNo3SCZ1B+h0hwX5UKSIsVt7FBPBlA=; b=xLfqp7eAPpb9y0iKs3C/jZIC9VVgiW5P3EfrWjxhuvWB7yJAcmk8aOAX1+Furw9Tp58UZf nbHGkeHkU/QgcuDQ== To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] objtool/urgent for 6.4-rc4 References: <168526035526.3457722.14103350194452732675.tglx@xen13> Message-ID: <168526035832.3457722.15229575761840032304.tglx@xen13> MIME-Version: 1.0 Date: Sun, 28 May 2023 09:52:59 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767126623418810056?= X-GMAIL-MSGID: =?utf-8?q?1767126623418810056?= Linus, please pull the latest objtool/urgent branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git objtool-urgent-2023-05-28 up to: 2e4be0d011f2: x86/show_trace_log_lvl: Ensure stack pointer is aligned, again A set of unwinder and tooling fixes: - Ensure that the stack pointer on x86 is aligned again so that the unwinder does not read past the end of the stack - Discard .note.gnu.property section which has a pointlessly different alignment than the other note sections. That confuses tooling of all sorts including readelf, libbpf and pahole. Thanks, tglx ------------------> Josh Poimboeuf (1): vmlinux.lds.h: Discard .note.gnu.property section Vernon Lovejoy (1): x86/show_trace_log_lvl: Ensure stack pointer is aligned, again arch/x86/kernel/dumpstack.c | 7 +++++-- include/asm-generic/vmlinux.lds.h | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 0bf6779187dd..f18ca44c904b 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -195,7 +195,6 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, printk("%sCall Trace:\n", log_lvl); unwind_start(&state, task, regs, stack); - stack = stack ? : get_stack_pointer(task, regs); regs = unwind_get_entry_regs(&state, &partial); /* @@ -214,9 +213,13 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, * - hardirq stack * - entry stack */ - for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) { + for (stack = stack ?: get_stack_pointer(task, regs); + stack; + stack = stack_info.next_sp) { const char *stack_name; + stack = PTR_ALIGN(stack, sizeof(long)); + if (get_stack_info(stack, task, &stack_info, &visit_mask)) { /* * We weren't on a valid stack. It's possible that diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index d1f57e4868ed..cebdf1ca415d 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -891,9 +891,16 @@ /* * Discard .note.GNU-stack, which is emitted as PROGBITS by the compiler. * Otherwise, the type of .notes section would become PROGBITS instead of NOTES. + * + * Also, discard .note.gnu.property, otherwise it forces the notes section to + * be 8-byte aligned which causes alignment mismatches with the kernel's custom + * 4-byte aligned notes. */ #define NOTES \ - /DISCARD/ : { *(.note.GNU-stack) } \ + /DISCARD/ : { \ + *(.note.GNU-stack) \ + *(.note.gnu.property) \ + } \ .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ BOUNDED_SECTION_BY(.note.*, _notes) \ } NOTES_HEADERS \