Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp641648rwe; Fri, 14 Apr 2023 07:56:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YPTAWBQ1vPacAVpxLF0HeJkV+ZjgSs7RWYk0YO26u9Me64nqkmjCDiBQKTFPcjUYudgETy X-Received: by 2002:a05:6a00:17a7:b0:635:3580:55e1 with SMTP id s39-20020a056a0017a700b00635358055e1mr9399977pfg.20.1681484166407; Fri, 14 Apr 2023 07:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681484166; cv=none; d=google.com; s=arc-20160816; b=hsBAJxZf5kG/JTlYGfWenu5ryE+3VHAZ+NuFi+UG7DapORer/PxZxDOZmWDIqNPKIj jfRxiJdNhqBTZ2jaaSGVaZvmQbUvZWY0BxxSZIJBllt7HLcXrFsRa3vITe+2xybCPXyq 85PHnkM8PcZ2fi+/X/cEkxxSTuCIGdiIvr6Vf28OGKxx04Wssr4nSgif2eH/PazdXGFY FDs/7UgNHu5TgijIgjbAeqm8tfrk4oW7vpxQssJsaBAiksdjUsnvxfQg5bYCobewtMly hRc/t0UZ83B2lMa6WVn6RW/eCKAJHuhIJxeAxsbGvDxHUdqYo2/P5BJSEkCzlUnm2pGb BrhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=2brZAFpo52iG6Oe/F9g2rqrK5dNYf8LiVl1mjLMwZhc=; b=QI17Pw9PxIhipbCkrtbUdM1Nz0qkLT//6Lb5ZVyBFBhr//oTR6vgOVYllq8ZD3+SIT 650zkZcXYh0PK7nppShvwzp2or3z/xAu1zjbSDCKqLo+SJVrp38dORdvnmfTHS26nmCH vpbIRi+x2lIuF5eCUjgqasLiKVwmvhE3x09G4TwY047RWfPcXEWKNunKtkx3EnmVzWG1 2uvpsokllfPBI9iswU/kJqF9cE9487+LGxlePgcQsTn0IjBFzZnPudlVjHO3kCZ59syy mti2T2ghquNBfSOr1821GUf/Qw2qVdvNJxze+ihxN6EjxSOSbbPzDGXNd/CwFoU6rpbn YAIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tMr2l7m8; dkim=neutral (no key) header.i=@linutronix.de; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020aa79d02000000b0063b00e84755si4334088pfp.342.2023.04.14.07.55.54; Fri, 14 Apr 2023 07:56:06 -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=tMr2l7m8; dkim=neutral (no key) header.i=@linutronix.de; 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 S231235AbjDNOsW (ORCPT + 99 others); Fri, 14 Apr 2023 10:48:22 -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: 7bit 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 The following commit has been merged into the objtool/core branch of tip: Commit-ID: f571da059f86fd9d432aea32c9c7e5aaa53245d8 Gitweb: https://git.kernel.org/tip/f571da059f86fd9d432aea32c9c7e5aaa53245d8 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 _printk() leaves .noinstr.text section Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/ee5209f53aa0a62aea58be18f2b78b17606779a6.1681320026.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 >= 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 = true; goto out; } if (lowest_sp < task_stack_low || lowest_sp >= 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 = true; @@ -86,11 +88,14 @@ static void noinstr check_stackleak_irqoff(void) if (*(unsigned long *)poison_low == STACKLEAK_POISON) continue; + 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 = true; + goto out; } + 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(); } static void lkdtm_STACKLEAK_ERASING(void)