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 B364AC282DE for ; Mon, 10 Mar 2025 17:52:08 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4ZBPbq1R1sz30Tk; Tue, 11 Mar 2025 04:52:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2604:1380:4641:c500::1" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1741629127; cv=none; b=kQDwIZAbIbIAV0IVcKnpruSIaJeQ/suvjPLqEaNtF90pxJ98f73fnsx2BUpxIvLf+/mU19/wETSl2BIxoVWbuWwZoMtGRAIKOoWtnjQs0ji1Ys3SCLqt7CCI8nwI4VxLgWnBG4/HuKLLyFKFXJu0nSFG1Jj47CW2C8/i31cJGSGT2vEeXzzhVnxNSfHO+UtVD21n6eOT1UCYfi1ZxDKnK5RlMkOVHA6UtaZrBWIIZ+jaqs5JJPfOTAgtnrOwTcgtLzQeX5U1hLLwdSXIvkN48PFURr4FIoDTMcc6HJdpxkLLEZvi/8NAQU6/ExytjsJuVdbkwruOpxM4CJ06SDWthg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1741629127; c=relaxed/relaxed; bh=58EyGn6oXyJA4euueOhQGd0RSCr644tjsgxpCjQxyNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NcatpJ4STl5DBM1UZ+kIDwAvaxMu0IjGsY0NjA5DPRfGk/R/3IKCpBn2MxkQImw9oXnqKjIZF4RfQKXMqWz86rLbBw0JhrVom0Kro3WTD0UX66Mfds1zRj/Qc6Tu2+vhBr8WH7ca9NQg54EijwkCDY2z3UvkKHwOo/mlF0cptqg5eG5M2YQBQ+xaaospTZKk4M79qR0zQ6dEc/pQr55xZbKw3Ad0zXfdU2BBMhbBcYvsbqhyAqy7Rvu6n21dcEyRj5laAU8ceFHOQDgrbGERtK7wPE2dkJ9C6fWryZ+4K9xpleL74YNKamm8ImvREzCdoUIUjNleQeo6k6+D0wFS9g== 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=VjVgSea9; dkim-atps=neutral; spf=pass (client-ip=2604:1380:4641:c500::1; 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=VjVgSea9; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 4ZBPbn5Jc1z30Sy for ; Tue, 11 Mar 2025 04:52:04 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5F6785C543B; Mon, 10 Mar 2025 17:49:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F64FC4CEE5; Mon, 10 Mar 2025 17:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629120; bh=N2V31bh7gpu64eKY1HB6O+qJjlQOufIsfaFh1DeRKBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjVgSea9kYxA86vQyOj0wjDpKqv2b27tXO+ksrKudUT1JnqGPUjvLDuen6OZo5sMq q0x30d5GKG+SLj/ahBHwpGhv5l37GaSsiEwiQU7xHImgYeE2g9T5ZeN/csrDI8VFBh oqGaaEE2fKEcm6yZpzrEh9AYj2N5qj5c8f+Z62zU= 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 5.15 153/620] module: Extend the preempt disabled section in dereference_symbol_descriptor(). Date: Mon, 10 Mar 2025 17:59:59 +0100 Message-ID: <20250310170551.643802978@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@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 5.15-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 eae9f423bd648..0f73f69e64035 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -66,10 +66,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