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

Open
#1,579 0 comments 2 reactions 0 assignees View on GitHub

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bmax121/APatch

All issues in bmax121/APatch

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.