From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796041642; b=Re8dckWNZbNDqUGu4QvfkGDKc/H2QbqC/D7gJ13WrfgHaXoR/zEiLZBfjeh5/UipzHiJ 8lCyvhfVclayIEaxu8tQY3TJuoJQ4ZO1LLclzYqH0nRGbLY8GxzSpfB66MRYrvmfATFjF MiFlyntN30barmWqkYn1/0hno2XghfK0C24OCvkZx5bD2Op3IFDsqMET4K2WuE7yLPweA Vvhl7c4AyO4BTTgMsiuTXz+KYEfvwzPO8Ibzhsv0pXJb+64AIucH+KGimuCqPyDcwFtlc 03v92KlM7klGVr0DdekyVIGwjS+mg7hUSwU8g58TwK6upMCU+CHAqdHrrD2JdcXrXLQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796041642; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=jXWfh8YHPEnmerUkDUyCLs1k5uIxKxKT0Id+4at8CQk=; b=CHsBCv2+KjTIsEUzu2VeqbIiNqgq+NaXote02QLqxKoyOGyo9itR4HCOhKPlFv8uZPNV l7Fj6mpAsKr549cbGoFmRciGN1Xuma9BfBXT21OyuE38w2WxyovjXgc2mW39kk5FcGsyw +hNMIVC2PT3m1nxS6VhPohS24Xwx0xKjfEvKcDdYOLoWZmkJbvd/5vrXZYrxEBSECvyjs h8Lt7psVoknUT2JvXMSR8tWnMQwbE9fhWSmUKUwDJPr4mELaRSDvI9uNpih8hCMgBxGgt kG6J4CEBz0OfrxRzSxvGFnaePCxjK31W+2xHBP47qN+hAd+nFC0BqzO9IOSNz3/tIAg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nzJwnPcg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5B3F606A31C for ; Mon, 30 Nov 2026 12:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nzJwnPcg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D0A81F00896; Mon, 30 Nov 2026 12:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796041642; bh=jXWfh8YHPEnmerUkDUyCLs1k5uIxKxKT0Id+4at8CQk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nzJwnPcgLnag59Pl3LxIzXJMeNXvL0f3x02nh8j0ChQ1RlLRRCan/aemu5k2uwPX+ g1YjRiBwBBR1Fe/kj96xVQpmg6Toa5CLTENvS5QZ+QKjsV5oyc0GW20WhCEcMIcPUp GGyh+q/Z7UyPT+K6mVqi2zil0AJJbe7wooBiWR46e3wF2zKIA3Ve+mhyOB5qDhrm1c IYUepqDPktNSzwwHSxZW3KL34/zOfu4dSNuxqcpDtZDn/IkhVvMGG++7hs/QejT7J+ GEGHYH40eA4AQNG2Hk44zE0wFFR1xEDeiHBLAnw904+KunopQIr7jt2ZyB75TP3v6j eTtx5FvvwkbWQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] uprobes/x86: Recognize user ENDBR64 without kernel IBT Reply-To: sashiko-reviews@lists.linux.dev To: "David Windsor" Cc: linux-perf-users@vger.kernel.org In-Reply-To: <20261130122035.1586780-1-dwindsor@gmail.com> References: <20261130122035.1586780-1-dwindsor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 12:27:22 +0000 X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > When a uprobe is placed at the start of a function, the prologue has not > run yet and the return address is still at *regs->sp. To capture the > caller, the unwinder checks is_uprobe_at_func_entry(), which looks at > the probed instruction for a push %rbp or an endbr64. >=20 > The endbr64 check uses is_endbr(). On a kernel built without > CONFIG_X86_KERNEL_IBT that is a stub returning false, so a uprobe on a > function starting with endbr64 is not treated as a function entry and > the caller is missing from the stack trace. Most binaries start their > functions with endbr64 since -fcf-protection=3Dbranch is on by default. >=20 > Whether the user binary contains endbr64 has nothing to do with whether > the kernel was built with IBT. Compare the probed instruction against > gen_endbr() instead, and move gen_endbr() out of the HAS_KERNEL_IBT > block so it is available without kernel IBT. is_endbr() is unchanged. >=20 > Fixes: cfa7f3d2c526 ("perf,x86: avoid missing caller address in stack tra= ces captured in uprobe") > Signed-off-by: David Windsor Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130122035.1586= 780-1-dwindsor@gmail.com?part=3D1