From nobody Thu Dec 18 07:53:37 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B13EBC77B76 for ; Fri, 14 Apr 2023 14:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231387AbjDNOsX (ORCPT ); Fri, 14 Apr 2023 10:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbjDNOsC (ORCPT ); Fri, 14 Apr 2023 10:48: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 8C3ACB76D; Fri, 14 Apr 2023 07:48:00 -0700 (PDT) Date: Fri, 14 Apr 2023 14:47:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681483677; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=2brZAFpo52iG6Oe/F9g2rqrK5dNYf8LiVl1mjLMwZhc=; b=tMr2l7m8cePaq8aDYJrS9FhpoJZf2Kxm8LGe1WbXS29jt5vguvqbUDCi4sx4WbmR+u3sXn /yBlZqUjsvcTSiF4pqo8rofuEu/nhpzaKd8aw+Dt/2PL2MJreKj+0PDcW52SeGTblrs90x v7StzyUvYeI+VfqTQIjKdcrKQr607eko+YQ8cMZRnsal1ugc+RW5z0aZghkcZg7Pi+loWV VBllWVwo6Ozft5YCwiYx7LcwH88fLivpNjtEBJV9rAybgiBgJOF7oi3jO0kqphSbjWp8HD +Yy4XFIwZAlDuLDC5cPjBpv8UF7trBXJhQPydBXGndZPeo8ar11kLJRysQtxgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681483677; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=2brZAFpo52iG6Oe/F9g2rqrK5dNYf8LiVl1mjLMwZhc=; b=V9IzN1G4/DXVVaH0p/oB/fVnG8LdeNCzbtZW2d3edze3PYeYjSP5qQCGDfDbVn/U/iW3B4 mxmqLpgMA1SxdgDg== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] lkdtm/stackleak: Fix noinstr violation Cc: Josh Poimboeuf , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <168148367693.404.11671377096764603064.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: f571da059f86fd9d432aea32c9c7e5aaa53245d8 Gitweb: https://git.kernel.org/tip/f571da059f86fd9d432aea32c9c7e5aaa= 53245d8 Author: Josh Poimboeuf AuthorDate: Wed, 12 Apr 2023 10:24:08 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 14 Apr 2023 16:08:26 +02:00 lkdtm/stackleak: Fix noinstr violation Fixes the following warning: vmlinux.o: warning: objtool: check_stackleak_irqoff+0x2b6: call to _print= k() leaves .noinstr.text section Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/ee5209f53aa0a62aea58be18f2b78b17606779a6.16= 81320026.git.jpoimboe@kernel.org --- drivers/misc/lkdtm/stackleak.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/lkdtm/stackleak.c b/drivers/misc/lkdtm/stackleak.c index 025b133..f1d0221 100644 --- a/drivers/misc/lkdtm/stackleak.c +++ b/drivers/misc/lkdtm/stackleak.c @@ -43,12 +43,14 @@ static void noinstr check_stackleak_irqoff(void) * STACK_END_MAGIC, and in either casee something is seriously wrong. */ if (current_sp < task_stack_low || current_sp >=3D task_stack_high) { + instrumentation_begin(); pr_err("FAIL: current_stack_pointer (0x%lx) outside of task stack bounds= [0x%lx..0x%lx]\n", current_sp, task_stack_low, task_stack_high - 1); test_failed =3D true; goto out; } if (lowest_sp < task_stack_low || lowest_sp >=3D task_stack_high) { + instrumentation_begin(); pr_err("FAIL: current->lowest_stack (0x%lx) outside of task stack bounds= [0x%lx..0x%lx]\n", lowest_sp, task_stack_low, task_stack_high - 1); test_failed =3D true; @@ -86,11 +88,14 @@ static void noinstr check_stackleak_irqoff(void) if (*(unsigned long *)poison_low =3D=3D STACKLEAK_POISON) continue; =20 + instrumentation_begin(); pr_err("FAIL: non-poison value %lu bytes below poison boundary: 0x%lx\n", poison_high - poison_low, *(unsigned long *)poison_low); test_failed =3D true; + goto out; } =20 + instrumentation_begin(); pr_info("stackleak stack usage:\n" " high offset: %lu bytes\n" " current: %lu bytes\n" @@ -113,6 +118,7 @@ out: } else { pr_info("OK: the rest of the thread stack is properly erased\n"); } + instrumentation_end(); } =20 static void lkdtm_STACKLEAK_ERASING(void)