From nobody Sun Feb 8 10:49:15 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C48CD312821; Mon, 26 Jan 2026 23:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769471814; cv=none; b=ev8iGidN03IfOmg8qluyd6cLW5a5UPCPC+pBeMM2FmexOsWqxiO1FbfXhSZHzxUlH0Xezup45NCO6kdn5dYRpeFJxXBd2SEpNnPs2K3b6F08V7CAfABfNSH7PdGF0sbQVfQVBcvRUBppsOEGkoB/QXsbpffTF4Ndq6ppzGG/2oA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769471814; c=relaxed/simple; bh=NXApr5KNg4OuK6Xci0SZbdbOL7udGKCix6UbbIxxYOo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BEt1WjJaJts9Rt0zgGUUBqwr50z9DYmb4JMUKghhbckPNX1NMS23Gd/c4vdmanzBtY454TH/ko5YDMx3EVXU6tsfEIcrGn8HMefLcdigwgeEw8eLQmnCHVkMPNO1pJ7FcrQ0+4AubbagV1qgDnFz0229i8NKzJQzEkN3iAbkEkU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ru0z142Z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ru0z142Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B91C2BC87; Mon, 26 Jan 2026 23:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769471814; bh=NXApr5KNg4OuK6Xci0SZbdbOL7udGKCix6UbbIxxYOo=; h=From:To:Cc:Subject:Date:From; b=Ru0z142ZUx5T9muKsSDTkuuwV+soSbWFKOekRPTf/eNOwcfV1a6YaF0FtVJPB30qi bhagpJKyOa1b8GGNpXDWB9Bg2T5C6TwRWKIBAd9hP2u9ER6GJAG75cZC0sLEfafpff gKy2s45OEJqwF6lmf9C93A1p7kxgN8k60TWgpXqNpuOVYTe9hZaBeOTAGwJ5hqeAty uUdchmIOjtjbg/b61WCrUR6mIOaRp5nbbLbJF1SKQWPLZPwu4F+i7lY8OOwpnCItt1 qxHeWzTc36iSmN8KKZHxZJmOKQpTpgYHBkFA9zR0z0VJKuD0+GMfw+Mlp2v3dh2aai VoyExdIxp5ETg== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Breno Leitao , Puranjay Mohan , Peter Zijlstra , Song Liu Subject: [PATCH] livepatch/klp-build: Fix klp-build vs CONFIG_MODULE_SRCVERSION_ALL Date: Mon, 26 Jan 2026 15:56:44 -0800 Message-ID: X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When building a patch to a single-file kernel module with CONFIG_MODULE_SRCVERSION_ALL enabled, the klp-build module link fails in modpost: Diffing objects drivers/md/raid0.o: changed function: raid0_run Building patch module: livepatch-0001-patch-raid0_run.ko drivers/md/raid0.c: No such file or directory ... The problem here is that klp-build copied drivers/md/.raid0.o.cmd to the module build directory, but it didn't also copy over the input source file listed in the .cmd file: source_drivers/md/raid0.o :=3D drivers/md/raid0.c So modpost dies due to the missing .c file which is needed for calculating checksums for CONFIG_MODULE_SRCVERSION_ALL. Instead of copying the original .cmd file, just create an empty one. Modpost only requires that it exists. The original object's build dependencies are irrelevant for the frankenobjects used by klp-build. Fixes: 24ebfcd65a87 ("livepatch/klp-build: Introduce klp-build script for g= enerating livepatch modules") Reported-by: Song Liu Signed-off-by: Josh Poimboeuf Tested-by: Song Liu --- scripts/livepatch/klp-build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 882272120c9e..a73515a82272 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -555,13 +555,11 @@ copy_orig_objects() { local file_dir=3D"$(dirname "$file")" local orig_file=3D"$ORIG_DIR/$rel_file" local orig_dir=3D"$(dirname "$orig_file")" - local cmd_file=3D"$file_dir/.$(basename "$file").cmd" =20 [[ ! -f "$file" ]] && die "missing $(basename "$file") for $_file" =20 mkdir -p "$orig_dir" cp -f "$file" "$orig_dir" - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$orig_dir" done xtrace_restore =20 @@ -740,15 +738,17 @@ build_patch_module() { local orig_dir=3D"$(dirname "$orig_file")" local kmod_file=3D"$KMOD_DIR/$rel_file" local kmod_dir=3D"$(dirname "$kmod_file")" - local cmd_file=3D"$orig_dir/.$(basename "$file").cmd" + local cmd_file=3D"$kmod_dir/.$(basename "$file").cmd" =20 mkdir -p "$kmod_dir" cp -f "$file" "$kmod_dir" - [[ -e "$cmd_file" ]] && cp -f "$cmd_file" "$kmod_dir" =20 # Tell kbuild this is a prebuilt object cp -f "$file" "${kmod_file}_shipped" =20 + # Make modpost happy + touch "$cmd_file" + echo -n " $rel_file" >> "$makefile" done =20 --=20 2.52.0