Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1211513rbb; Mon, 26 Feb 2024 02:15:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWGYeMT8dAE5OUvAwD2aEMqCtd3srR3Vdmjc+3vOwG8OUp76aNZG2/FiGPOAtFF38vi3DvTs4KdRIeTxePl3igIkWwhaBbGrDgc7V+KlQ== X-Google-Smtp-Source: AGHT+IEvx7zyqXtLQVADMGOXL/VYAqU7I2ZbqJxRLMLiGdOTGz9KssKxsfMeOLv1AjRcimC8XiJ3 X-Received: by 2002:a05:6a21:1519:b0:1a0:f9e1:2d24 with SMTP id nq25-20020a056a21151900b001a0f9e12d24mr3712911pzb.18.1708942514599; Mon, 26 Feb 2024 02:15:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708942514; cv=pass; d=google.com; s=arc-20160816; b=Gr7bBPgfQ8nOP9+YYczt+Bqxbps3iUFjpDecZ7+DJuc8poYLQ2zanejKFglb4WM0Bm ueR9X9dHBC5BqaHf1VyyqfL4fpoOIubo8csHN012M9M/4HQspTyVLuZ3rFbCX+A4/3VT vT5B5v8jz73cigRSMApNC4t4Jdy+jtkpsHlqhpaqGbvTz7A3D5XDfPKikokzrssLxP7+ NTKTe+Wd5hWPXChNFGUs34JZBQm0WQ64tInSX3+Y71cEGAAE6Ur4HYAqPs3jC2JD2p1Z 3SmzPS1LoJgh9W+56Wm18byWxgAFQKlKT4RVwf63lRBzdiGkO55RM0IgSvjLgZdApiub U53w== 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=5d69Z1hSg4N+Xx0zsmQeCV2rcSQlkCkO33X0RouPP+g=; fh=GcVQc4YiazKl30IVBBvT0I/oQVYFp9+6Aoa1KxdXIn4=; b=KZ/p10ULef+ESLdYPUx8xq1i+ddLyxUZ+xmWNSeYum3vJDlNEqmlj272/T2FIjCjCS Y8RMOyYSroImg5EP8GXVh2cFCr8LlstydHL9AArS+tUcFDwVLSHpWQm/WovwkBXEPNJ4 KLzR5S0P4iocrOEpZg5/8A47sknxro0uKUi25sgw2WbrWLzDGFKO2Btfaau51p0/6Nx2 X6hwPiz9GnFvwxmivIe5rb4OrGZby7I/+4PDdiZ4fNNjkgD1ZFAm3wDEa2B2HYy38cFz R+bpiu8UJMH+xWBIDDzSwxllcM6CVyDLMexoPIj6tg9kOcsRs4Sg4IVFHBgQhXOCxOff 7kCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=glzpOUSo; 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-81092-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z4-20020a62d104000000b006e5129b4168si1603093pfg.119.2024.02.26.02.15.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:15:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81092-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=glzpOUSo; 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-81092-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81092-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3FDF3289CE9 for ; Mon, 26 Feb 2024 10:10:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2A56241E9; Mon, 26 Feb 2024 09:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="glzpOUSo" Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (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 E5013208A3 for ; Mon, 26 Feb 2024 09:49:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708940980; cv=none; b=KxQXI7eJmbq9VKQpyfhmlXjvZmtFxdHCRD6ucvxlEBkrNHMygR4pN6mvhP+G3hgC0Gac3s19pXw42uzkiQzNjr+lIwl1UoM6i7mC94B6wVpa3e/EJ9f+AFDtx7qO5dMr+PGiXguTqkUJSh2F24m+krrG9eNrxM+A6UtG+i7LWm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708940980; c=relaxed/simple; bh=Fwm8S8Vb+z4RwJL7/WDN7b9qb2t2HZ9vae8gSBT44uE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mcIvtwNlsqm1UaDNEVm8l4Ah0aa6qaaB4cMRSUSfzISAVhoUADc5zQ/FPrGqM/6yWHgMnI9LFmbO8cRXj9mkNJi6EoZZxuYGDZat4+MT+YFqvpMFf8Uka2k1s3Pd4DRyiTPStnmGu46mAO408trSTVFhrOYeDSHWM+KzMkYOFf4= 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=glzpOUSo; arc=none smtp.client-ip=209.85.215.179 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-pg1-f179.google.com with SMTP id 41be03b00d2f7-5cf2d73a183so1495580a12.1 for ; Mon, 26 Feb 2024 01:49:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708940976; x=1709545776; 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=5d69Z1hSg4N+Xx0zsmQeCV2rcSQlkCkO33X0RouPP+g=; b=glzpOUSoJgz/9ISO9ub1FrCf9qJ97TOvWpBA7tXcNw7IpUPPc3f2oKgurqtY3VuQM2 aUsxG7ZVU+TSbWvSFate/XYq08iexAv0u39N4Ra8AF0p/PPaWyAk6VZUwTAzo3/Btlbe j1SrfHjkdchw+k9xAw4VdgrDPIB68eQCjkI4WVdIRH2LsHIKhRK+ogMo8JCBc4y/gGEt 5TU+gwlIcFIXjM8U2KHWxR0nNTu5AZQvN6JlHcudcxD3hGhJPODKDkzY6fOJDEXjwBrf tpyPs52OYnVU7pbPDjebp35A/AGbcoEEdN9LGXxBfw3dQ0PNoaYnQ2NUARM/p4S0uVrD /H+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708940976; x=1709545776; 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=5d69Z1hSg4N+Xx0zsmQeCV2rcSQlkCkO33X0RouPP+g=; b=rWiQlZVcGB4CpM6F8HzpuROvTjF83Sxonghbb+3UB8sLTh+vZcqrM4SGIMmF939qjE YkyW6zl8uZ2jldbqXy4Rgk4IO81SrIPCBsZ4aF7N9/A9fxtkRmohtFK1z6EBtLQtNEgE mp40FF8Eg4s5Pr20ieBSFCVQ0OKh7CCAj2UqCwMR4gAGjd7y+m+seKXDWV6M8HZOJ3lU 1nhA9S76pDOhIQQMFmLheApSadgemHPZ7yzGj8LNICt3DIveMg8hz1Ubw8lMoqvTi0aV snAlZZs9b4EOSEpaYy2ohU/bPGBq5EDZ8nywe2G6SbXCF9g9BYmclWFAYbBbWn6ScKRt DCRA== X-Forwarded-Encrypted: i=1; AJvYcCW3VaF/jYNJ2CjOeHLsnWA+tRKyOZcPmv/Ft14XmqtWxnhfScLcJ84vCOrVvU1inGFijafzvCpp/cCkhcdJERlltHfYAvF1MTYSoeOh X-Gm-Message-State: AOJu0YwvQ96yKqGF2ynD8Xq0UOIeHH1Mbst1nQ/HdGlVUUXHLkKSA3sO UXxcJ2wZOR4kAzL6uicGGyA45mk2ckLNt2sukuZn7kn5lCGJwGCII6GE8Y+hJLo= X-Received: by 2002:a17:90a:fd8c:b0:296:e8e3:13c7 with SMTP id cx12-20020a17090afd8c00b00296e8e313c7mr8665219pjb.10.1708940976196; Mon, 26 Feb 2024 01:49:36 -0800 (PST) Received: from C02CV19DML87.bytedance.net ([203.208.189.12]) by smtp.gmail.com with ESMTPSA id x19-20020a17090ab01300b002990d91d31dsm5934779pjq.15.2024.02.26.01.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 01:49:35 -0800 (PST) From: Rui Qi 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, Rui Qi Subject: [PATCH 0/3] Support intra-function call validation Date: Mon, 26 Feb 2024 17:49:22 +0800 Message-Id: <20240226094925.95835-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 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)