From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62D7A17CA12; Mon, 10 Mar 2025 17:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629121; cv=none; b=lNRx7D2z+aZaW3+AsRwqakNqGCK6Vr1mUkqv8guAR0E72qWSH7HS4T+e3PAm/bjGUTwHNnR7O1fvtjyvpYNv2ZBj3sNYT6BjF8f5FXxyo3RQ1rKUKS/7itPYwmzqya5BdRrBE8LPfVytxJbndbG3a7jGrhnwKjggRjDkLV5bDRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629121; c=relaxed/simple; bh=N2V31bh7gpu64eKY1HB6O+qJjlQOufIsfaFh1DeRKBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iXoCpsoFKU2RpPS2XI+yaJ3HSi/D7AnptVu3jtro0UZwncYSRqzKyTQ1o5/HJAf1PAqGba7hxTC8P8m5xwevnVWXKmoisgvlt6RbPcpGYPLqt63APC5KIiHcxx/qGTKLmO55NZr/VeKScQUDHLdUK64lzwkt8cNTB3dVSbcs7S0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VjVgSea9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VjVgSea9" 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 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: 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