From nobody Mon Apr 6 19:59:13 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 5031C37CD42; Wed, 18 Mar 2026 08:25:20 +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=1773822322; cv=none; b=YCZSm8KXL9Gx72l1/j5Dk3TzUZW19ICBeLBq+6q/EPFRGLNisRvzxbsjuA2rnUpdG802WEPIEHJhL0MgVfdsngLFFNkA1dJ7+MT028KEGuTUzl9Um1YSJ31gc8Tzvz4vNU6PeIwSMjqQNA3nKtzNmvekmXobdj8OHO17s1AbjZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773822322; c=relaxed/simple; bh=LYDtAUtvwzi95doFe6FqbsfAHadxt2rn/4biVoWwNJw=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=O/5xWkZiAu2Q7h37ZEq9VL2NHhn85qbtZZBF+uNaMXxFtpxd5oaj/OE8xF4oLl39woq1wjlu94GdRNK6L9uiJ9yyyYITxS0iDnSXAoFbc7ePRX3r0PNyJ9Cn3DxgjJUIoveDiosAMd3QOSvzvzSsychA/i0H0x3aNjJZgmO0ffE= 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=LqePkXIl; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qqmDL5hj; 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="LqePkXIl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qqmDL5hj" Date: Wed, 18 Mar 2026 08:25:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773822313; 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: in-reply-to:in-reply-to:references:references; bh=aXCM5PHIHyzeSJkWyZ1Td9c66q6xUrblKF5/CGacrV8=; b=LqePkXIlLDoxXWDGJYqBHikPEaB5Xu6b5d0qw4HxbZ7/+7tohQiw1SvhBEg0Dq3BEA5Fu8 9TXfEOM00qh9jGZg8JviswDj9bR58tN6UfLoyLZcdg/qswMwqiKk7O5DR+f+k8dGwEHFLe +gwa9jmjiHM0UnAoAIvRZijjHvkIRIf7CQFAo/gdnbrWQ4LJLqd+zA3Ju+4IknXjLBB0Vx 88S9As3BReGj5Pzz7tQvhQRkjUzDGiQNxcdt++dBh7RdkHCNu1X85rO9gvY9rS8APdDoNG bAS5lhsttkB7HKJYt+OEu011HDIW8Jf2ubNvTFm0QRqEUl0QzwVp8rgtZM711Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773822313; 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: in-reply-to:in-reply-to:references:references; bh=aXCM5PHIHyzeSJkWyZ1Td9c66q6xUrblKF5/CGacrV8=; b=qqmDL5hj4VYaO6aw7/wywEwmN/8ZcVUGH8VOmsYcCcrRf/t8LyI+8BZshH0SRiy2v3T2Uz 0okJFnoC7VksELDg== From: "tip-bot2 for Joe Lawrence" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] livepatch/klp-build: report patch validation fuzz Cc: Joe Lawrence , Song Liu , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260310203751.1479229-13-joe.lawrence@redhat.com> References: <20260310203751.1479229-13-joe.lawrence@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177382231157.1647592.5884916146421537347.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: 51a0b7c4ede5c775e9d362e5f465ca993e076823 Gitweb: https://git.kernel.org/tip/51a0b7c4ede5c775e9d362e5f465ca993= e076823 Author: Joe Lawrence AuthorDate: Tue, 10 Mar 2026 16:37:51 -04:00 Committer: Josh Poimboeuf CommitterDate: Mon, 16 Mar 2026 12:52:53 -07:00 livepatch/klp-build: report patch validation fuzz Capture the output of the patch command to detect when a patch applies with fuzz or line offsets. If such "fuzz" is detected during the validation phase, warn the user and display the details. This helps identify input patches that may need refreshing against the target source tree. Ensure that internal patch operations (such as those in refresh_patch or during the final build phase) can still run quietly. Signed-off-by: Joe Lawrence Acked-by: Song Liu Link: https://patch.msgid.link/20260310203751.1479229-13-joe.lawrence@redha= t.com Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index d628e2c..839f9b6 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -360,11 +360,24 @@ check_unsupported_patches() { =20 apply_patch() { local patch=3D"$1" + shift + local extra_args=3D("$@") + local drift_regex=3D"with fuzz|offset [0-9]+ line" + local output + local status =20 [[ ! -f "$patch" ]] && die "$patch doesn't exist" - patch -d "$SRC" -p1 --dry-run --silent --no-backup-if-mismatch -r /dev/nu= ll < "$patch" - patch -d "$SRC" -p1 --silent --no-backup-if-mismatch -r /dev/null < "$pat= ch" + status=3D0 + output=3D$(patch -d "$SRC" -p1 --dry-run --no-backup-if-mismatch -r /dev/= null "${extra_args[@]}" < "$patch" 2>&1) || status=3D$? + if [[ "$status" -ne 0 ]]; then + echo "$output" >&2 + die "$patch did not apply" + elif [[ "$output" =3D~ $drift_regex ]]; then + echo "$output" >&2 + warn "${patch} applied with fuzz" + fi =20 + patch -d "$SRC" -p1 --no-backup-if-mismatch -r /dev/null "${extra_args[@]= }" --silent < "$patch" APPLIED_PATCHES+=3D("$patch") } =20 @@ -383,10 +396,11 @@ revert_patch() { } =20 apply_patches() { + local extra_args=3D("$@") local patch =20 for patch in "${PATCHES[@]}"; do - apply_patch "$patch" + apply_patch "$patch" "${extra_args[@]}" done } =20 @@ -444,7 +458,7 @@ refresh_patch() { ( cd "$SRC" && echo "${input_files[@]}" | xargs cp --parents --target-dir= ectory=3D"$tmpdir/a" ) =20 # Copy patched source files to 'b' - apply_patch "$patch" + apply_patch "$patch" "--silent" ( cd "$SRC" && echo "${output_files[@]}" | xargs cp --parents --target-di= rectory=3D"$tmpdir/b" ) revert_patch "$patch" =20 @@ -817,7 +831,7 @@ fi if (( SHORT_CIRCUIT <=3D 2 )); then status "Fixing patch(es)" fix_patches - apply_patches + apply_patches "--silent" status "Building patched kernel" build_kernel "patched" revert_patches