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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD403C02192 for ; Wed, 5 Feb 2025 14:31:33 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Yp2jc23qrz3013; Thu, 6 Feb 2025 01:31:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738765892; cv=none; b=mqOtCVXWIhj/GGt6t4gI8uZ9TSHN4BwDXdSqmwFSdVA4XLD1L8NwiheivSl0dZy2dyli9Ybc5UISopVpHi+5BpDi0xQP9LPcerUq8nfYzzrp23lAi3nAEOz2X2dhbcNAGWETElRhbr2mzcHYUrklC2TS/is/2uPnmdxCYEzOdDoixrtDGW4Gb7ER043Fi2+x4aiHn7sHKgkX+PL0pHoMKCTE0z/jV+qXPsjSR5DdV/ItA+lY76ZCaS2n8qmQv75xIza+Qw2kKyw5N+W4F0uN3p8Bb/7LSJJAWbYIBM/MMqHcUTfjss3PWc9idv5TAr1kmh0jkSJQwmXE/liMBkj89Q== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738765892; c=relaxed/relaxed; bh=i6kHd7wpWMdNgzHRU81o3c8WeS710W5wrzyYmaB3fD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C6QY8GB0M29MInbecnPIYUI4qWAKP1ToYknDWalamRUeVtbouZ3p7UKWX1JKXb/49AmT9cgk8YaRzlrtREdkhzSkg5R4NOt1JvwCP624UoxsjbAmQFHoGycbv1y6vC4lnn2Rk0B7E3A907ktS3DL7WqAl0aSE8nMovU0IU1VFe+3QAUX/YLVOfKsU4oeijJMmLrKHDe9Jzb6pRNmgiThe0plk2g9lOEnKNe1i1yvq2awkGNzZtLmXMDtUHuSGqviHOQO88oKrPNE7b8z20z+ZREqNPjWLDl9JU8DzbCsZggCXbJUGqoGBdD83aE2i4NoKKMWWPgqeBebrUs/LOWZwA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X9d+FXZr; dkim-atps=neutral; spf=pass (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) smtp.mailfrom=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X9d+FXZr; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Yp2jb36HSz2ydW for ; Thu, 6 Feb 2025 01:31:31 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 18E085C5C58; Wed, 5 Feb 2025 14:30:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB6C0C4CED1; Wed, 5 Feb 2025 14:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738765887; bh=nSU1N/H7Kbw4NWQWtDGR2D+RngV5y/67tsTzqxG2RQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9d+FXZrRh8SRtZt5l77axtbpK/UpnirP/YGmW0VcLN2Fv+YZ3+9tRA36J+yXg93J rXyZB58EAMg4VnA+S2j2kuwcOpVjkM7gq9tKAqVVThOWQSPrfzppAIGWEcgT+YQdND UARy21Y+KJqlr6P5jt1/e8RqDYEzrxjbbxFDuJ+Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "James E.J. Bottomley" , Christophe Leroy , Helge Deller , Madhavan Srinivasan , Michael Ellerman , Naveen N Rao , Nicholas Piggin , Sergey Senozhatsky , linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Sergey Senozhatsky , "Peter Zijlstra (Intel)" , Sebastian Andrzej Siewior , Petr Pavlu , Sasha Levin Subject: [PATCH 6.6 309/393] module: Extend the preempt disabled section in dereference_symbol_descriptor(). Date: Wed, 5 Feb 2025 14:43:48 +0100 Message-ID: <20250205134432.131530756@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205134420.279368572@linuxfoundation.org> References: <20250205134420.279368572@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Andrzej Siewior [ Upstream commit a145c848d69f9c6f32008d8319edaa133360dd74 ] dereference_symbol_descriptor() needs to obtain the module pointer belonging to pointer in order to resolve that pointer. The returned mod pointer is obtained under RCU-sched/ preempt_disable() guarantees and needs to be used within this section to ensure that the module is not removed in the meantime. Extend the preempt_disable() section to also cover dereference_module_function_descriptor(). Fixes: 04b8eb7a4ccd9 ("symbol lookup: introduce dereference_symbol_descriptor()") Cc: James E.J. Bottomley Cc: Christophe Leroy Cc: Helge Deller Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Naveen N Rao Cc: Nicholas Piggin Cc: Sergey Senozhatsky Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Sergey Senozhatsky Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20250108090457.512198-2-bigeasy@linutronix.de Signed-off-by: Petr Pavlu Signed-off-by: Sasha Levin --- include/linux/kallsyms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index c3f075e8f60cb..1c6a6c1704d8d 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -57,10 +57,10 @@ static inline void *dereference_symbol_descriptor(void *ptr) preempt_disable(); mod = __module_address((unsigned long)ptr); - preempt_enable(); if (mod) ptr = dereference_module_function_descriptor(mod, ptr); + preempt_enable(); #endif return ptr; } -- 2.39.5