From nobody Mon Dec 29 00:40:27 2025 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 0B7DAC10F04 for ; Sat, 2 Dec 2023 13:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbjLBNIM (ORCPT ); Sat, 2 Dec 2023 08:08:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjLBNIK (ORCPT ); Sat, 2 Dec 2023 08:08:10 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 442B0119; Sat, 2 Dec 2023 05:08:16 -0800 (PST) Date: Sat, 02 Dec 2023 13:08:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701522493; 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=Ahtf6qtGLkSFfzmKo7NT7kkLqGD19uzWB44u2/ZhTpI=; b=L9PND/m0+A3zEJvrkuKQ/MakGvjD/5B66zjE4CZEK0P2U/uSg5TlOGU2NTv5A++yunWgpB GKC2AAKEJxKQOmLSoyyiHoiHIr1ce+6x9ZEmhSWYK0XqdAhnu2bMBBha0ZuqlUEeXxHHR+ c0xsnjTDvS2XkW14I0qymYgljALCJpmrMKXVkXu+ybBDWgfMVF/VAsJokPPTlhApkYD1U4 g20oTh8cBIdyx1O6s6WNeTwOVVQ+Hja8DBh5njl7TQP3vWMykM3RjdvHGVgTTYSc88EeWS 4wICZNk0UF+Cf4oxlbZmj30+K0vOmgrF2G3rlRkJ8qQv1R/69SwbKJC9q8aL9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701522493; 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=Ahtf6qtGLkSFfzmKo7NT7kkLqGD19uzWB44u2/ZhTpI=; b=ce9VhqqKCeR9Zs6Zb8m/ol+M10bds++4dJzmwwgqpFQVN/p6K/HKeDJXb5xv+14qOnFl+7 0qY0wDvoiqiBeuAA== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/percpu] x86/callthunks: Correct calculation of dest address in is_callthunk() Cc: Nathan Chancellor , Uros Bizjak , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231201085727.3647051-1-ubizjak@gmail.com> References: <20231201085727.3647051-1-ubizjak@gmail.com> MIME-Version: 1.0 Message-ID: <170152249271.398.7485179912974283410.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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/percpu branch of tip: Commit-ID: fc50065325f8b88d6986f089ae103b5db858ab96 Gitweb: https://git.kernel.org/tip/fc50065325f8b88d6986f089ae103b5db= 858ab96 Author: Uros Bizjak AuthorDate: Fri, 01 Dec 2023 09:57:27 +01:00 Committer: Ingo Molnar CommitterDate: Sat, 02 Dec 2023 10:51:28 +01:00 x86/callthunks: Correct calculation of dest address in is_callthunk() GCC didn't warn on the invalid use of relocation destination pointer, so the calculated destination value was applied to the uninitialized pointer location in error. Fixes: 17bce3b2ae2d ("x86/callthunks: Handle %rip-relative relocations in c= all thunk template") Reported-by: Nathan Chancellor Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Closes: https://lore.kernel.org/lkml/20231201035457.GA321497@dev-arch.theli= o-3990X/ Link: https://lore.kernel.org/r/20231201085727.3647051-1-ubizjak@gmail.com --- arch/x86/kernel/callthunks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c index f56fa30..2324c7f 100644 --- a/arch/x86/kernel/callthunks.c +++ b/arch/x86/kernel/callthunks.c @@ -312,7 +312,7 @@ static bool is_callthunk(void *addr) if (!thunks_initialized || skip_addr((void *)dest)) return false; =20 - *pad =3D dest - tmpl_size; + pad =3D (void *)(dest - tmpl_size); =20 memcpy(insn_buff, skl_call_thunk_template, tmpl_size); apply_relocation(insn_buff, tmpl_size, pad,