Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1216307rbb; Mon, 26 Feb 2024 02:27:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhOGGlgYtGO8vWTkGuNCSUMwX6yxZAItYYwxy46fAUpMAGRPIsT8zSYoOtJpzott6gQ57GyKj+LNrQme4W/LxNLvjsvQQoct2pY4cz9A== X-Google-Smtp-Source: AGHT+IH1DnT4BzqpxJj3xkulveKjNu0hbUJhsvhJ2bst/2kgZ/B2YHwpijfXatTAaFsMoefkMA5c X-Received: by 2002:a17:90a:a89:b0:299:3332:a649 with SMTP id 9-20020a17090a0a8900b002993332a649mr4531071pjw.18.1708943245442; Mon, 26 Feb 2024 02:27:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708943245; cv=pass; d=google.com; s=arc-20160816; b=s4nvWz/ID+lSe0gfB856TAnAVT85U3XFO3oFQEbEkb26bJ64jW9RQm9lT6QyaekKza 1TFa0zVxAKHkX9/aBj8W2mJV/8emRpyW7YJrjpOnVT86z1DgKdy72RBE9wAuG/pdYF7F 7EblW4UimuuT8+W6niphenJK5vb/YQYynBBMqShS8UCgFnU9qQzBfKua0WIRUNKn8kFl SmD6DjYux90tvePfjsqau3P8aguibe0D00qwz+sAmoH278I9Tp+WSB6RKDML9a6/MBkp eQBLlSZyz4GqOYhcjPLI69HB7wAbO0TR3TwgJDn1/BgeGSRmV0nZnrSqC7aMnjpbAp6w Pxpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gbQaXGx202MYUih537vCjMC9neGAB2aCaE4Hy7lgplw=; fh=YvBziMh7MbmDVC6umpr9Bn8CwtTidUsmES7ePMR4HnY=; b=BxZSCg+QBtIcE9BU9EisVYSZDafrl03GzSF2/TBv1Kp/k2TXzW/Yx7gcn084tgJIZ/ +F7hPUll2GBRGlobGVTF7ssruz5m8pnX8oGHi7O+0swvFg0kFKqUgFTEkDFEoBr35Nzs /DhzRFKX88/qHlt/tlLcmz0aQRExO4Wj33hayN4ksNycxLwp355ajD42xBYPHbCmptsU l5f/mPuUApd9nBrNM88XYAbUQvSwV+XvxBAryRYF+6qzYu4X4Xqn3gpvW7YUShiqX2Jt kM7NIEcCQa+5we4BKrquDZop7ByIfbqIskJ8wL2XEtAvW8H3ksQmqTYAon2Ea9KVCWT2 AqRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="h8/+EL5W"; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-81056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id pt7-20020a17090b3d0700b0029ad1898413si428819pjb.134.2024.02.26.02.27.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:27:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="h8/+EL5W"; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-81056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81056-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 276FFB210DE for ; Mon, 26 Feb 2024 09:59:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 189325811E; Mon, 26 Feb 2024 09:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="h8/+EL5W" Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95CF5731A for ; Mon, 26 Feb 2024 09:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708939906; cv=none; b=tWJq8Tyy5J33lphEeZ/gnO0X4SyjJ+w/1W/JaUfJHewMlHBCRj/WRUj6Zeklh246qOBbnxaiGdo1OiM6rsU5BwM23lkHW0qgsNMxUZOLnLTFE3795hvRWhjT7WEWsxyqr8enxGGgEyVulYFKSronVhCW295Yfd1W7DveaCsnhPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708939906; c=relaxed/simple; bh=oMwEwBsS9LpqWFkXQJGn/wGr2D2RG9J1+84Vl1zgefc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ZsGt78Ca9wYItER7IR3+oHKcmF9tnB/z/nE4SQAmWb8mOTWEB70MpJ77FHl1/CB1iWZwrMA8lOoR6VfZzMvLsNDYxC+4/RtoL0P//IYxNm7Lqf/tTQed2UnRYc+X6MhAZBZ9no/C4KhzX7jjOKla5b0S+tXDZrCPa7EGA6D1qq4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=h8/+EL5W; arc=none smtp.client-ip=209.85.166.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-36521bd11a6so8050065ab.2 for ; Mon, 26 Feb 2024 01:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708939903; x=1709544703; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gbQaXGx202MYUih537vCjMC9neGAB2aCaE4Hy7lgplw=; b=h8/+EL5WaBr9GK6/F/s/38m8F6UPwXXgldRJNPunHwVbQgr7YDpsL+koRonuYQOul/ damgjLUV6PP+icnzNGeOiYhYQMuQlRmU98phonhhrDhONbGdJe8JKIWDlj64w+vizN95 PbMCOgQVK9GBXY+glMwDuRLeM48dIQJFXFcXmTCwjfMpoL2y1GEECBEkR/l1aCXLklTq 2RWUyKn2PNcntDiUnZLh64sAP60tElQdBBEmrzrXQEuEjeBaeN5zP/0TIiiaQfn4QBbG 74alzU/YFPbTZ7KVYymJT/8EjZN2CSkpU9VJZ009aMlFfg0NeblxpQFx3qf4YOYbhxPQ 78SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708939903; x=1709544703; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gbQaXGx202MYUih537vCjMC9neGAB2aCaE4Hy7lgplw=; b=k8wwyvIdMcCxQJsgUY6XBkKzYA5ngakIbIlbFQV0gzXJGJtB+tV/1AS4+m//nu9mNC YmVgpMn1pVIP+M8sttgK/R6aHbzfFRIi/KxGf6URWE8Q1ZeXAsEFa9amZDnRiIJaW7/b Nk/w7cenA6iLBIP+5YogWqMGJi0uqcn/alAzSPZkXAMfQth9TGPMCYEOkddFv6xDxqRy CZtGinjdRfplzQlsN2siki9fWdS3hzbhrNwT9Sp/3NUJEYspsLoJruqINUchiVS9YssW tUdUQT9gQogtQbj4JD9VVs6fGhNWHDSH9h9HKKxg2MqzdX1yZZFXtKN0GBRJ4tEc9Vkk 4Ojw== X-Forwarded-Encrypted: i=1; AJvYcCVCn8jgj4/lMQILGjmVBf/7nfbkhc430zsE1mruix5b44W2O9cXPBk+M1rfLwEQCgTVWA69yUwkIMHXrM9TnqIQMRoBkdGP5sipWG0l X-Gm-Message-State: AOJu0Yy3gHOl/ta94OkGtDQWjYbYr7G8Vn6njBazjkwLWIZ4627ByOFI NgpF2xd4+lAX6CL7vCIFiBNQ8HIG8DIX/pT+ZpdjKofZ5r8cr87NSJwB9cGlMJ0= X-Received: by 2002:a05:6e02:214d:b0:365:bf3:60e2 with SMTP id d13-20020a056e02214d00b003650bf360e2mr9636330ilv.6.1708939902818; Mon, 26 Feb 2024 01:31:42 -0800 (PST) Received: from C02CV19DML87.bytedance.net ([203.208.189.14]) by smtp.gmail.com with ESMTPSA id z6-20020a63e546000000b005d68962e1a7sm3539555pgj.24.2024.02.26.01.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:31:42 -0800 (PST) From: "$(uname)" X-Google-Original-From: "$(uname)" <$(mail address)> To: bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jpoimboe@redhat.com, peterz@infradead.org, mbenes@suse.cz, gregkh@linuxfoundation.org, stable@vger.kernel.org, alexandre.chartre@oracle.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, qirui.001@bytedance.com Subject: [PATCH 0/3] Support intra-function call validation Date: Mon, 26 Feb 2024 17:31:30 +0800 Message-Id: <20240226093133.94909-1-qirui.001@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Rui Qi Since kernel version 5.4.250 LTS, there has been an issue with the kernel live patching feature becoming unavailable. When compiling the sample code for kernel live patching, the following message is displayed when enabled: livepatch: klp_check_stack: kworker/u256:6:23490 has an unreliable stack After investigation, it was found that this is due to objtool not supporting intra-function calls, resulting in incorrect orc entry generation. This patchset adds support for intra-function calls, allowing the kernel live patching feature to work correctly. Alexandre Chartre (2): objtool: is_fentry_call() crashes if call has no destination objtool: Add support for intra-function calls Rui Qi (1): x86/speculation: Support intra-function call validation arch/x86/include/asm/nospec-branch.h | 7 ++ include/linux/frame.h | 11 ++++ .../Documentation/stack-validation.txt | 8 +++ tools/objtool/arch/x86/decode.c | 6 ++ tools/objtool/check.c | 64 +++++++++++++++++-- 5 files changed, 91 insertions(+), 5 deletions(-) -- 2.39.2 (Apple Git-143)