From 30c37847e133f0601a29962102a0da8b5b8acffe Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Sat, 2 Jun 2018 16:01:32 -0500 Subject: [PATCH] kpatch-build: detect truncated Module.symvers "make mrproper" combined with the '-t' flag is dangerous, as it results in the Module.symvers file getting truncated, which causes create-diff-object to create some funky dynrelas. Detect this condition in kpatch-build and error out. We will hopefully also be removing "make mrproper" soon, which will make '-t' even more useful. Fixes #589. Signed-off-by: Josh Poimboeuf --- kpatch-build/kpatch-build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index cf44789..db26373 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -724,6 +724,8 @@ if [[ ! -e "$TEMPDIR/changed_objs" ]]; then die "no changed objects found" fi +grep -q vmlinux "$SRCDIR/Module.symvers" || die "truncated $SRCDIR/Module.symvers file" + # Read as words, no quotes. # shellcheck disable=SC2013 for i in $(cat "$TEMPDIR/changed_objs")