ClangBuiltLinux / linux

Linux kernel source tree
Other
241 stars 14 forks source link

Undefined reference to __efistub_kasan_check_write #298

Closed nathanchance closed 5 years ago

nathanchance commented 5 years ago

I am seeing this error on next-20181218 with this diff during an arm64 allyesconfig build:

aarch64-linux-gnu-ld: drivers/firmware/efi/libstub/arm-stub.stub.o: in function `__efistub_install_memreserve_table':
__efistub_arm-stub.c:(.init.text+0x80): undefined reference to `__efistub_kasan_check_write'
make: *** [Makefile:1043: vmlinux] Error 1

The same diff works on v4.20-rc7. I spent all day doing a bisect (allyesconfig bugs SUCK), which it points to a rather large merge commit. I assume that means I either did something wrong or there were conflicts while merging that could be causing this issue. I'll try to diagnose this further when I have time, posting now to see if anyone else has any ideas now.

Bisect log:

git bisect start
# bad: [285053b5a4c0204840fb92cfaba06352718e2eed] Add linux-next specific files for 20181218
git bisect bad 285053b5a4c0204840fb92cfaba06352718e2eed
# good: [7566ec393f4161572ba6f11ad5171fd5d59b0fbd] Linux 4.20-rc7
git bisect good 7566ec393f4161572ba6f11ad5171fd5d59b0fbd
# good: [02cd32ee4877cf85c974aa8f6a0c476b62b50b3b] Merge remote-tracking branch 'spi-nor/spi-nor/next'
git bisect good 02cd32ee4877cf85c974aa8f6a0c476b62b50b3b
# good: [6039b883e7ac680e2cf50c48d7e43df51560b7bf] Merge remote-tracking branch 'iommu/next'
git bisect good 6039b883e7ac680e2cf50c48d7e43df51560b7bf
# bad: [01104bbc1f023c892bce0af9ac3edbfa81e3b480] Merge remote-tracking branch 'char-misc/char-misc-next'
git bisect bad 01104bbc1f023c892bce0af9ac3edbfa81e3b480
# bad: [d8c818068833da6870ef936cde7c241bdc31cfa6] Merge remote-tracking branch 'edac-amd/for-next'
git bisect bad d8c818068833da6870ef936cde7c241bdc31cfa6
# bad: [d8c818068833da6870ef936cde7c241bdc31cfa6] Merge remote-tracking branch 'edac-amd/for-next'
git bisect bad d8c818068833da6870ef936cde7c241bdc31cfa6
# bad: [8a07942573871223f1a3106ccd85860599b262c9] Merge branch 'x86/fpu'
git bisect bad 8a07942573871223f1a3106ccd85860599b262c9
# bad: [a90e1f2720a46ab45d70f118bede6c91f0e4b268] Merge branch 'locking/atomics'
git bisect bad a90e1f2720a46ab45d70f118bede6c91f0e4b268
# good: [eaaf055f27a0eaaed0cdb0d3aa8d7fb892829ccb] Merge branches 'bug.2018.11.12a', 'consolidate.2018.12.01a', 'doc.2018.11.12a', 'fixes.2018.11.12a', 'initrd.2018.11.08b', 'sil.2018.11.12a' and 'srcu.2018.11.27a' into HEAD
git bisect good eaaf055f27a0eaaed0cdb0d3aa8d7fb892829ccb
# good: [11792e665ae2c6a7abf0ba19a3ce735430de9467] Merge branch 'core/rcu'
git bisect good 11792e665ae2c6a7abf0ba19a3ce735430de9467
# good: [d7c2830906cd192ba1498d3be41e0b6f9ef19d78] Merge branch 'irq/core'
git bisect good d7c2830906cd192ba1498d3be41e0b6f9ef19d78
# good: [c0df10812835040e261b915f04887b0cf0411851] arm64, locking/atomics: Use instrumented atomics
git bisect good c0df10812835040e261b915f04887b0cf0411851
# good: [4607abbcf464ea2be14da444215d05c73025cf6e] tools/memory-model: Model smp_mb__after_unlock_lock()
git bisect good 4607abbcf464ea2be14da444215d05c73025cf6e
# good: [a6f1de04276d036b61c4d1dbd0367e6b430d8783] tools/memory-model: Make scripts take "-j" abbreviation for "--jobs"
git bisect good a6f1de04276d036b61c4d1dbd0367e6b430d8783
# first bad commit: [a90e1f2720a46ab45d70f118bede6c91f0e4b268] Merge branch 'locking/atomics'
nickdesaulniers commented 5 years ago

IIUC, merge commits make bisecting with git difficult, because if you test synced to the merge commit, you get a lot more patches then syncing to merge commit minus one.

nathanchance commented 5 years ago

Workaround patch from Arnd: https://lore.kernel.org/lkml/20181211133453.2835077-1-arnd@arndb.de

Turns out it is commit c0df10812835040e261b915f04887b0cf0411851 in -next that tickles this on arm64.

nickdesaulniers commented 5 years ago

cc @arndb

nathanchance commented 5 years ago

I've gone ahead and bumped the patch on LKML: https://lore.kernel.org/lkml/20190108022659.GA13470@flashbox/

nathanchance commented 5 years ago

Patch accepted: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=fff1ed79f88ea748e467cd4f509869d90627e125

nathanchance commented 5 years ago

Whoops, this was a linux-next only issue and it's been fixed since next-20190130: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b871ad292427957201e2f654316d722ab1c40561

Closing now.