From nobody Sat Jun 13 22:18:36 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1972247DFB1; Tue, 5 May 2026 10:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978590; cv=none; b=RW/oHg97IQQ535X2fXQ6UeTJ3l/21UHJi3dxAPOU8ZT1nx6HaKleHAEQd113V2ZvfZj7EkXsY9BaRZuYXyYUxZ0Zhyw0Gj9gwwJivrsWWN8Ki3ZxZZEFk+U1H4Vo8OAnfU8QqUgu0cP/lswQ88+jxti1L1tsT5WhdbBnZKOQK30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978590; c=relaxed/simple; bh=q8KPSxPxbt4EGYBIpO1NEhD2/hE/DED4CXSTtBEoMdc=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=JdCzmEu8YAdQlzxQTuTt5vHj4lzJOryUvpP1BnCtm+cpLphcRY6dd5JHsHB6tASVzPMbmfVP2tSr2o5DFqgDgVWsqXexH6IKBKTOrFkf7dAfmRKM8y9L6PeWtJPCpdRHN+A86t11ZsiEHrXWgBfydoYdtu0788wJn3sn7v2M5mQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kLlGIxGZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=+cRAGx3j; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kLlGIxGZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+cRAGx3j" Date: Tue, 05 May 2026 10:56:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978587; 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; bh=i0WS6hCO6ogVJmlG/sySIjuwqO8nRvdTXSi23pzHg5k=; b=kLlGIxGZaaXHpnbpRfDqS1kddnvcm6c/7H2nV9bO4p2+JOFuGyRAmM7ilcCrgVyibuiDlY GoOKa9vo4ChYwn7LLJAOscR1pvr1giUFuZebVyLX2Zj4EycOEoN9W4dkTa588Qu4sUnWMQ 4OYtnuKxybXImJsfCJSZUC3h+32o0fRPqrVKv+FARhQygqe0yHRtG+y21z6eYavn9+x18A 0GGsUX3MxsdqzjIY7zov19Guyusj5BYMMOPJEo9a13hldYQPTejsRdowuoORF5USxAzlX3 eDrxdWMctBOH9Jhh0ecOdHnTI/rGEaF5RVXao28sz1xlkhnjr7V/kAQW9IZsjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978587; 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; bh=i0WS6hCO6ogVJmlG/sySIjuwqO8nRvdTXSi23pzHg5k=; b=+cRAGx3jdRNkzbhE/6Hi6XvvkiUdU7z+/xvT1tEDRHBP3gZp530nehcZcQPWg3L6qu/DJ/ hUMyMCingOCwWnBQ== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] klp-build: Fix checksum comparison for changed offsets Cc: Song Liu , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177797858621.424702.588940672082919914.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the objtool/core branch of tip: Commit-ID: ba77fe55781a2464f68b6c13b4b31d05abd2abcf Gitweb: https://git.kernel.org/tip/ba77fe55781a2464f68b6c13b4b31d05a= bd2abcf Author: Josh Poimboeuf AuthorDate: Fri, 10 Apr 2026 21:49:56 -07:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:16:02 -07:00 klp-build: Fix checksum comparison for changed offsets The klp-build -f/--show-first-changed feature uses diff to compare checksum log lines between original and patched objects. However, diff compares entire lines, including the offset field. When a function is at a different section offset, the offset field differs even though the instruction checksum is identical, causing the wrong instruction to be printed. Only compare the checksum field when looking for the first changed instruction. Also print both the original and patched offsets when they differ. Fixes: 78be9facfb5e ("livepatch/klp-build: Add --show-first-changed option = to show function divergence") Acked-by: Song Liu Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index e19d93b..8f0ea56 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -727,13 +727,29 @@ diff_checksums() { ) =20 for func in ${funcs[$file]}; do - diff <( grep0 -E "^DEBUG: .*checksum: $func " "$orig_log" | sed "s|$= ORIG_DIR/||") \ - <( grep0 -E "^DEBUG: .*checksum: $func " "$patched_log" | sed "s|$= PATCHED_DIR/||") \ - | gawk '/^< DEBUG: / { - gsub(/:/, "") - printf "%s: %s: %s\n", $3, $5, $6 - exit - }' || true + local -a orig patched + paste <(grep0 -E "^DEBUG: .*checksum: $func " "$orig_log") \ + <(grep0 -E "^DEBUG: .*checksum: $func " "$patched_log") | + while IFS=3D read -r line; do + read -ra orig <<< "${line%%$'\t'*}" + read -ra patched <<< "${line#*$'\t'}" + + if [[ ${#patched[@]} -eq 0 ]]; then + printf "%s: %s: %s (removed)\n" "${orig[1]%:}" "${orig[3]}" "${orig[-= 2]}" + break + elif [[ ${#orig[@]} -eq 0 ]]; then + printf "%s: %s: %s (added)\n" "${patched[1]%:}" "${patched[3]}" "${pa= tched[-2]}" + break + fi + + [[ "${orig[-1]}" =3D=3D "${patched[-1]}" ]] && continue + + printf "%s: %s: %s" "${orig[1]%:}" "${orig[3]}" "${orig[-2]}" + [[ "${orig[-2]}" !=3D "${patched[-2]}" ]] && \ + printf " (patched: %s)" "${patched[-2]}" + printf "\n" + break + done || true done done }