Boot failure on Linux 4.14 with CONFIG_CFI_CLANG=y: kptools reports `no symbol: report_cfi_failure`, which only exists on 5.x+ kernels
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- android, linux
- Domain
- operating-systems, security
Research direction
Start in the kptools path that resolves report_cfi_failure, using the kallsyms_lookup_name output and the kernel's System.map as references. Reproduce with the reported Linux 4.14.357-openela CONFIG_CFI_CLANG configuration and inspect handling of __cfi_slowpath, __cfi_check_fail, and cfi_shadow. Done means the older CFI symbols are handled without breaking patching and the resulting image boots on the reported device.
Written by the indexing model from the issue text.
Description
Summary
On a non-GKI Linux 4.14 kernel built with CONFIG_CFI_CLANG=y, patching reports
success but the device does not boot. During the patch, kptools prints
no symbol: report_cfi_failure. That symbol does not exist on 4.14 — the
equivalent CFI machinery there is named __cfi_slowpath / __cfi_check_fail /
cfi_shadow.
Device / kernel
- Xiaomi Redmi Note 10 5G (
camellian, M2103K19G), MediaTek MT6833 - LineageOS 23.2 (Android 16, SDK 36), unofficial, self-built and self-signed
- Kernel 4.14.357-openela, arm64, non-GKI, built with clang r383902
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_BASE_RELATIVE is not set
CONFIG_LTO_CLANG=y
CONFIG_CFI_CLANG=y
CONFIG_CFI_CLANG_SHADOW=y
APatch 11224, kpimg version d03 (built 15:13:08 Aug 5 2026).
Log
Flashed through LineageOS recovery via adb sideload. From /tmp/recovery.log:
[+] kernel version major: 4, minor: 14, patch: 255
[+] try kallsyms_offsets first for 64-bit relative-base kernel
[?] find approximate kallsyms_offsets error
[+] fallback to kallsyms_addresses scan
[+] approximate kallsyms_addresses range: [0x01382200, 0x014bd438) count: 0x00027647
[+] kallsyms_num_syms offset: 0x014bd500, value: 0x00027647
[+] kpimg version: d03
[+] kallsyms_lookup_name: type: T, offset: 0x0028b688
[?] no symbol: report_cfi_failure
[+] patch done: ./kernel
[+] Repack completed: new-boot.img
Symbol resolution itself works: the kallsyms_addresses fallback finds 161863
symbols. The kallsyms_offsets path fails because CONFIG_KALLSYMS_BASE_RELATIVE
is not set on this kernel, which seems handled correctly.
The patched image is written to the boot partition and the device then fails to
boot. Recovery requires flashing an unpatched boot image over fastboot.
CFI symbols actually present
From System.map of the built kernel:
__cfi_check
__cfi_check_fail
__cfi_slowpath
cfi_shadow
cfi_module_add
cfi_module_remove
__ubsan_handle_cfi_check_fail_abort
grep -c report_cfi_failure System.map returns 0. Upstream, report_cfi_failure
appeared when CFI was reworked for 5.x; the Android 4.14 CFI backport uses the
names above.
What I am and am not claiming
I have not instrumented the boot, so I cannot prove causation. What I can say is
that the patch completes, the only anomaly reported is the missing CFI symbol,
and the resulting kernel does not boot — which is consistent with inline hooks
tripping __cfi_slowpath because CFI was never neutralised.
Question
Is 4.14 with CONFIG_CFI_CLANG=y expected to be supported? If the older symbol
names could be recognised alongside report_cfi_failure, this would cover
Android 4.14 vendor kernels built with the CFI backport, which is common on
MediaTek platforms.
I still have this device and the full build tree, and can test patches or gather
any log you need.
- Dominant language
- Kotlin
- Stars
- 8.2k
- Forks
- 809
- Avg merge
- 7d 17h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bmax121/APatch
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 4 days
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
bmax121/APatch#1669 · 2 comments ·
Maintainers usually reply within 4 days
-
Direct Install reports success when boot partition write failsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
boot_patch.sh: flash guard precedence allows flash attempt on missing new-boot.imgMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 4 days
Similar issues
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsotto/sotto-authenticator#68 ·
Maintainers usually reply within 1 day
-
mobile prio:low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
digitalfabrik/entitlementcard#3324 ·
Maintainers usually reply within 2 days
-
Contributions are welcome Type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
owncloud/android#5065 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
sameerasw/essentials#1913 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainers usually reply within 1 day