From nobody Sat Jun 13 22:03:35 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 6518D47D94D; Tue, 5 May 2026 10:56:24 +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=1777978585; cv=none; b=WbNqzFVOTp4sQAfacjGqtT68OAjOTFLxTiJt4DywFr97AP41XaZivPrJT1n+QUsn3Lvk6J60v4TbZFC4GzV2sXx8OhkV4lBVmIyh/E4X3rbfVJ8d/zyZE1gKZbk7E/DHlIb1tquasd4SWAgtejOv0UlZZjju0D0MeWLWmocKzQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777978585; c=relaxed/simple; bh=EERagjfWOWqUyiam2sFNA2awPoYYdGEOraeoeqhrRz0=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=Ai3/awd1NX6cihEYt131UJm0PnA0i9E5V9TGnBWtcALShvzB8bDY+xahol343cbJDziuBhI8Ssm/4eDbZ1iK77kPK6Zb04Y+wDgiaEt7tjGJJDHfMl6vhWAHI2T98GQ8X54UfN3cTctZzAqtDO+Ok1OwQyNjJwkGJNCfxpkomhs= 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=Am/f3iPu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xnu3VaND; 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="Am/f3iPu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xnu3VaND" Date: Tue, 05 May 2026 10:56:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1777978582; 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=6CZvLsJOL3oRDc89nXmcjhA9kL/rdiZw/iCtXRS+Xrk=; b=Am/f3iPuL7t3sRiAuHnloxkR9dD7tR8ix4z31KYlOvMuDaM34535C2b+InbIAH14OHN7Ns 1ghuamnba6jk/etr9TnOKrV72j0JPtWdZWSDRZMI9NnlqZLU8tggQqWZwLbymWNpG79wdv fkLbuWycEAzJelRUFxwFcqGnSSATNux3pbVmYn0DCSzNpBw5gZYg+HOuSPT2U//5kb4d9H RcLLvFxz7AkiX6uP5BXuNYOQlPk8q94vazyw52tFjfpxUz8gKSlZKtgaokpLPsSe7IfNxi B5NDPnW1/WaPxTwz3tiBWCmL03FjHDE4pWRAy4uawyfOyqCBGeCmNzvL+erwbw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1777978582; 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=6CZvLsJOL3oRDc89nXmcjhA9kL/rdiZw/iCtXRS+Xrk=; b=xnu3VaNDV1jMuKms6im3Y6u10mp1h01qLAmwGlASWTJYvgt4i5f5s2oJJSzIPjC2vHm3S1 g3x336FuqjZtsQDQ== 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 patch cleanup on interrupt 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: <177797858161.424702.5908297465586339343.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: f3048888ea62ac1c573db91e74e0dcabe058e89f Gitweb: https://git.kernel.org/tip/f3048888ea62ac1c573db91e74e0dcabe= 058e89f Author: Josh Poimboeuf AuthorDate: Thu, 02 Apr 2026 19:08:39 -07:00 Committer: Josh Poimboeuf CommitterDate: Mon, 04 May 2026 21:16:03 -07:00 klp-build: Fix patch cleanup on interrupt If a build error occurs and the user hits Ctrl-C while a large patch is being reverted during cleanup, the cleanup EXIT trap gets re-triggered and tries to re-revert the already partially-reverted patch. That causes 'patch -R' to repeatedly prompt "Unreversed patch detected! Ignore -R? [n]" for each already-reverted hunk, with no way to break out. Fix it by adding '--force' to the patch revert command in revert_patch(), which causes it to silently ignore already-reverted hunks. And ignore errors, as the cleanup is always best-effort. For similar reasons, add to APPLIED_PATCHES before (rather than after) applying the patch in apply_patch() so an interrupted apply will also get cleaned up. Fixes: d36a7343f4ba ("livepatch/klp-build: switch to GNU patch and recountd= iff") Acked-by: Song Liu Signed-off-by: Josh Poimboeuf --- scripts/livepatch/klp-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index dc2c5c3..9970e1f 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -384,15 +384,15 @@ apply_patch() { 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") + patch -d "$SRC" -p1 --no-backup-if-mismatch -r /dev/null "${extra_args[@]= }" --silent < "$patch" } =20 revert_patch() { local patch=3D"$1" local tmp=3D() =20 - patch -d "$SRC" -p1 -R --silent --no-backup-if-mismatch -r /dev/null < "$= patch" + patch -d "$SRC" -p1 -R --force --no-backup-if-mismatch -r /dev/null &> /d= ev/null < "$patch" || true =20 for p in "${APPLIED_PATCHES[@]}"; do [[ "$p" =3D=3D "$patch" ]] && continue