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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 586E5C7EE22 for ; Tue, 9 May 2023 03:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234592AbjEID4D (ORCPT ); Mon, 8 May 2023 23:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbjEIDzk (ORCPT ); Mon, 8 May 2023 23:55:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE111D05E; Mon, 8 May 2023 20:55:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C014F63133; Tue, 9 May 2023 03:55:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16513C433D2; Tue, 9 May 2023 03:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683604516; bh=ljTxyucIRDttnYxn8OYDAsFD42hJcSoKDHU6eCAObKU=; h=From:To:Cc:Subject:Date:From; b=tKS0RpHsGdXmylzIeOfwy5HNUrMrNfC7xQN9xTQGR6YC8IHkOm6jhE8cMSjtxNgs1 b7tdO7krjCuuFgsHJl9UNvSgfTjsGl9emUYYI5pfGHrLHVSU6Il6tBwdxgg0lNxhWT ODv299uTShRMTfsMtCJb1BYMvGMDLNcZ4wa+gykQiKK8gginflpKpt5RL1w1E8UlDo zXwiaP8qIIYWGQg0QxVmZg2CP8hzE91hOi3SwFK01sqA8aoxjqBlckPy2mTOyWKxg3 GtF/cBfMhT64ZEB2uD7AYPZRj6iOpLoKl4979Ajc/MWvNvbuGN83lK8K74uhTyHrcf jCD2ptX85kMnA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Josh Poimboeuf , Peter Zijlstra , Sasha Levin Subject: [PATCH AUTOSEL 6.2 1/6] sched: Fix KCSAN noinstr violation Date: Mon, 8 May 2023 23:55:07 -0400 Message-Id: <20230509035515.59855-1-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Josh Poimboeuf [ Upstream commit e0b081d17a9f4e5c0cbb0e5fbeb1abe3de0f7e4e ] With KCSAN enabled, end_of_stack() can get out-of-lined. Force it inline. Fixes the following warnings: vmlinux.o: warning: objtool: check_stackleak_irqoff+0x2b: call to end_of_stack() leaves .noinstr.text section Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/cc1b4d73d3a428a00d206242a68fdf99a934ca7b.1681320026.git.jpoimboe@kernel.org Signed-off-by: Sasha Levin --- include/linux/sched/task_stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h index 5e799a47431e8..f158b025c1750 100644 --- a/include/linux/sched/task_stack.h +++ b/include/linux/sched/task_stack.h @@ -23,7 +23,7 @@ static __always_inline void *task_stack_page(const struct task_struct *task) #define setup_thread_stack(new,old) do { } while(0) -static inline unsigned long *end_of_stack(const struct task_struct *task) +static __always_inline unsigned long *end_of_stack(const struct task_struct *task) { #ifdef CONFIG_STACK_GROWSUP return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1; -- 2.39.2