Message ID | 20240226094101.95544-1-qirui.001@bytedance.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-81073-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1972186dyb; Mon, 26 Feb 2024 02:04:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUfw6Bzm8ppQADaZPlEKSBoyj3hiKH1O5gLIrXarGfYORTP65FTHML4hCpu7TUWRPCCeVPRxLwY46yYSPYlA5bTK1Vs8Q== X-Google-Smtp-Source: AGHT+IHVga0t1Jg8mVPjHQNZmDJhB8x/LCxeV8t4ZrBtJgxfmzjvhKYHJPmKxxZL57rG+aGCaRAT X-Received: by 2002:ad4:5764:0:b0:68f:89fe:28f2 with SMTP id r4-20020ad45764000000b0068f89fe28f2mr11611685qvx.9.1708941885703; Mon, 26 Feb 2024 02:04:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708941885; cv=pass; d=google.com; s=arc-20160816; b=wZS7T+oZt2F90eLIhb++y8i7jPlIU/euUb0zKQcBEBZY4cegZwY+hX04IkpUQvyCo7 oa9zo0bTCV2e47Oj9EDxq5WW5N1U0oYToOKjyI7gw0Kx2cglNBRh1kVJ/VUr8QsxTTrw KmYHxXjNcEJZMqGFPBhFeNs/Wza9z/g1nHB47Qn2ss5dprLarEdo8eyyIosoJlPiR3zF szwwvbLlia8kZJXccTaZOHiFxmTfpj6gMILH6JBcvBFx+JO5+ezCrxsrUwzSDR6geB4z RXQ31ecRrD5BbO6AV1ecYMaPCRTK6NhOCInVFofudyQoxAushHPrf0wq63aeLvERB5o+ PiCw== 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=uSj6YhJqfSEa+N/72fVB0dW1aVxLOWGPr6gHnj/uys0=; b=UulGihpOHssqyTQFGTw2hZZcimHIdlD6ujfTtQflFFYL4Z/X6a6S7TvEpCP3iaGJLm mK1nn8Z3kDzvD6jvFOtE81OGdgyY3qPhzAGiINmUbEJswGnxBKzgKTrL4a5dmCmawZTm uxv9eTYR9U7DMT3W+7p+TF46LvL3sEwBlPpVIQ5fyIcIV+U4q6ByFAIRe8WdJVaQa5u6 cpPbY8AHXfVfHeqmM2DM3KBbDiyUB5hI63eL6D7wbea3oNKlmFcZKDNqpNMPGO96DjMo VzAtgQ0+r6bFdq7y5nvmP2Atp9f6DYnZq/Y5y1B88PGB0KzzHS07sf7lS5etYdCYEho0 S6+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=FZ+k0Plf; 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-81073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81073-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ed5-20020ad44ea5000000b0068cb4c6ecdbsi4886552qvb.317.2024.02.26.02.04.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:04:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=FZ+k0Plf; 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-81073-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81073-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7FB831C21EE8 for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 10:04:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C68B5F874; Mon, 26 Feb 2024 09:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="FZ+k0Plf" Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 540C5219ED for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 09:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708940474; cv=none; b=BF+UF+C2bJJuI2OCa+43exJCcYPC1towCWd627sNYruxH2lNPGeKnXNFH/Jhe2NlinceD0T+adMXskOs737RtRblZqolrcNW6sX/I6v6w+1jU/OjldhKFwf1bqdFfxDK6D5kyvqSML3dMzt/z8erJ+1a9YH/8V8iwvhKvwRgmEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708940474; c=relaxed/simple; bh=oMwEwBsS9LpqWFkXQJGn/wGr2D2RG9J1+84Vl1zgefc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MvxL21mMvv/MhRckUjaA2GR5LR/DaV6EP1sgLBJe8e+mIHWneuw1GEnKjq9cdKbZo3PkrFlecBD7ZCbuesgITrL5UXFrTF5egfvzAymBETRrfof9/nZOV+JLan1s7DAWNRSJzQj0ZBKQ9z9F7/5IlkYk0hXfhCMRih+IwxL9ris= 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=FZ+k0Plf; arc=none smtp.client-ip=209.85.167.170 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-oi1-f170.google.com with SMTP id 5614622812f47-3c1993331a7so1236114b6e.1 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 01:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708940472; x=1709545272; 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=FZ+k0PlfQr/3MUCxf1HI2tCXfYUNfM4j2ibM+rAe+4EhJ5Y6L5v7UPDJCfaMv7Qgfm YcB88ozct7BzujyhYsmaMgCgskNhIbq2hSdAM4zbpcGvKmhcxjfApD/6xtN+x+Onm/sg Jwe1l4e6K9ACiiTKmgngausbIwjXmW1T5kn6h1bQeauigU3ZwFGYZf5zTpLgEeJ+je1u 9ch35GuqfqRM3HKx0gPSuW5ZzRjfHUrg/NP5K8/ZyMgMfUZxJI0AQ3rSwX8xuBx8je9q LJqPWnqHAVHKRty8QHN0IypurVLDMCYO6TsL/ZXPXv+H4txObnRfcHIUeriiYqHWmcc2 z96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708940472; x=1709545272; 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=FLtBMQ/t9dzhye2FSrWhmL/iqGjEkdl6jteYSu+KTox6n4GOzsH7SA/jQt6+DJDXFm BXXQTLLYhobxIwvJjMKogI179uwJArCFio9UbrimWftr4m+3GaYvs3SEAopRTycL6oDd G1JSeOa0mk4W3ZVT1UIJv3nE/eRxLwW76ZOnznm2619q9mCJVL5D0ggNi9J+94xw6/JH iMtnUDeAmQDRlOL90li+Vgshih/gG1mYswBtfQuVGK8ju49Ov4CBVbPG7NdQ++NbSMrI bgvyMkZu4vltGk/V2HP3flX9135iYi8YvVIVqq9FR7d7lqTbFaeQYAZrY0gQxwNwGfe/ tdMw== X-Forwarded-Encrypted: i=1; AJvYcCXgvPpO5xNzmRokvV5pMOpEl3e4oXC3zIwjaKJIB2fNybpB4T8Y+ACrom76f76VMpb0nu1fXGiFTMcPFNFnQHqumzJZLzL17zRq6fk5 X-Gm-Message-State: AOJu0YyHFrpjO8TZ2+LMlfWM1DCPGvu9/PkWkDlCq1Y8OYpoFEQDYsj6 10EAvD1+b1OYPW6rxMdhzpOI2lgEuijlcLySlOMM65ctpP2ih4MM0E0vMz7rDEzzrE7c/7FGsc4 B0P+C516TKke3tw== X-Received: by 2002:a05:6808:1644:b0:3bd:cdec:ba04 with SMTP id az4-20020a056808164400b003bdcdecba04mr7266464oib.58.1708940472482; Mon, 26 Feb 2024 01:41:12 -0800 (PST) Received: from C02CV19DML87.bytedance.net ([203.208.189.6]) by smtp.gmail.com with ESMTPSA id ls22-20020a056a00741600b006e533caee00sm949194pfb.155.2024.02.26.01.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:41:12 -0800 (PST) From: "$(name)" <qirui.001@bytedance.com> X-Google-Original-From: "$(name)" <$(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:40:58 +0800 Message-Id: <20240226094101.95544-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791955111285933661 X-GMAIL-MSGID: 1791955446741994598 |
Series |
Support intra-function call validation
|
|
Message
Rui Qi
Feb. 26, 2024, 9:40 a.m. UTC
From: Rui Qi <qirui.001@bytedance.com>
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(-)