On Wed, Jul 15, 2026 at 10:52:27AM +0100, Kees Cook wrote:
> +/* UDF base pattern with KCFI bit: cond=0xe, 0x7f, xxxx, 1xxx, 0xf, xxxx */
> +#define CFI_UDF_IMM_BASE    0xe7f008f0
> +#define CFI_UDF_IMM_MASK    0xfff008f0       /* Mask for UDF + KCFI bit 
> matching */

With this patch applied, KGDB and CONFIG_CFI cannot be used together. 
Setting a breakpoint causes Oops as CFI failure.

This patch on top of "ARM: breakpoint: CFI breakpoints only on demand",
multi_v7_defconfig + CONFIG_CFI=y + KGDB/KGDB_KDB/MAGIC_SYSRQ, THUMB2_KERNEL=n,
clang 22.1.8 LLVM=1, qemu-system-arm -M virt -cpu cortex-a15, booted with
kgdboc=ttyAMA0. 

Then "echo g > /proc/sysrq-trigger":

  sysrq: DEBUG
  CFI failure at kgdb_breakpoint+0x2c/0x58 (target: kgdb_breakpoint+0x2c/0x58; 
expected type: 0xc0472d70)
  Internal error: Oops - CFI: 0 [#1] SMP ARM
  Modules linked in:
  CPU: 0 UID: 0 PID: 1 Comm: init Not tainted 
7.2.0-rc3-00278-g38436106b2f5-dirty #1 VOLUNTARY
  Hardware name: Generic DT based system
  PC is at kgdb_breakpoint+0x2c/0x58
  LR is at kgdb_breakpoint+0x2c/0x58
  pc : [<c0472d70>]    lr : [<c0472d70>]    psr: 60000013
  sp : e080dea8  ip : 00000000  fp : 0021a1c0
  r10: 00000000  r9 : 00000000  r8 : c2004048
  r7 : c2205d9c  r6 : 00000000  r5 : c1609558  r4 : c22bb994
  r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : 00000000
  Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
  ...
   kgdb_breakpoint from __handle_sysrq+0x150/0x158


Thanks,
Karl

Reply via email to