Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1666804rdb; Sat, 2 Dec 2023 05:08:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEceYRzc8bFXn0jiXnlYW/sAp54hg7vvcPE8mOUXWpqAPT0zCYrWR1ggrIYz2BjAa7Skskh X-Received: by 2002:a05:6a20:1456:b0:18b:826c:411b with SMTP id a22-20020a056a20145600b0018b826c411bmr1653087pzi.17.1701522502189; Sat, 02 Dec 2023 05:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701522502; cv=none; d=google.com; s=arc-20160816; b=an1onnU/3yWfzrT33rZWpMfS2/LtJv4yqvQXWVDt/W+Sv7iCWwN4Z7cznr2V53Oj2s DkOMonm9Jf57cyqYgmLlh4663eUPK+ZIgdq+pD6rZwN/O6W5SWFFVqmVdlWkZkd2gtyt KGIosMUoDxmBO7mRXFBiuXMlXzHNJvjd71pbriWim39tpdpZGbjLc7z2W+Owm1wdDLrI 4WMaU5k/yC4rr65F6NFKHEJL6ggRIMBaZFGJ5t21/A0mOaSD3XJb3uLVk6gPPJd/duS7 oJVo9dtJI1xGLdY4wQ4qadGDUbJFQqQn//F7Rfh7yVrN/lllNsMYyYbFrF48bKmZoBly IRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=Ahtf6qtGLkSFfzmKo7NT7kkLqGD19uzWB44u2/ZhTpI=; fh=6nb+o1eAWRernNjo9d+NWUXWMFjnuraqXdvwSCS0QGM=; b=UXkelr0aZMyoPEr1T7b1R0/0tzYjjWmrC0sZItQOLITqKZaRDsU7RA7UsUGESsJv+E NRnd8F4jjzKtt+Ap+TNEuo2b2RIi/+NQusgqMVi+dCROOLsSt04uxGb9Of5tWGFCFob/ CkIM2P2q284yKhBknbeJLrFnRD7loXqyex9PAwfCMAM+Z9MTRB+g/kzqs3fyerOFGQdn 2U0L331wqSU9qTi6CahSZddQFv5UkOBVyhN1mj0VMQVnPT7rcFdX9ogn1zfz2IyjhD6d MAYCe5K5uORcNRv5yTbHamXhgYMh6JYpf2ATiDiejbgaF+z/OB1idXl5GNTI+oC6xczM /V6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="L9PND/m0"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l3-20020a656803000000b005c65d99188esi1034548pgt.34.2023.12.02.05.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 05:08:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="L9PND/m0"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CDF3780A5FA1; Sat, 2 Dec 2023 05:08:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232745AbjLBNIL (ORCPT + 99 others); Sat, 2 Dec 2023 08:08:11 -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: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 02 Dec 2023 05:08:20 -0800 (PST) The following commit has been merged into the x86/percpu branch of tip: Commit-ID: fc50065325f8b88d6986f089ae103b5db858ab96 Gitweb: https://git.kernel.org/tip/fc50065325f8b88d6986f089ae103b5db858ab96 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 call 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.thelio-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; - *pad = dest - tmpl_size; + pad = (void *)(dest - tmpl_size); memcpy(insn_buff, skl_call_thunk_template, tmpl_size); apply_relocation(insn_buff, tmpl_size, pad,