ANDROID: Makefile: Fail the build if RUST and CFI are both enabled
Enabling CONFIG_RUST changes the compiler's CFI flags so that we pass
'-fsanitize-cfi-icall-experimental-normalize-integers'. This results in
a silent KMI break (i.e. one which is not detected by our ABI tooling)
and has been shown to prevent loading of modules which differ from the
kernel in their value of CONFIG_RUST:
| init: Loading module /lib/modules/6.6.30-android15-8-maybe-dirty-4k/kernel/mm/zsmalloc.ko with args ''
| CFI failure at do_one_initcall+0xd4/0x360 (target: init_module+0x0/0xfe4 [zsmalloc]; expected type: 0x6fbb3035)
| Internal error: Oops - CFI: 00000000f2008233 [#1] PREEMPT SMP
To help avoid this silent KMI breakage in the future on android15-6.6,
add a diagnostic error to the top-level Makefile when both RUST and CFI
are enabled.
Bug: 350371019
Cc: Matthias Männich <maennich@google.com>
Signed-off-by:
Will Deacon <willdeacon@google.com>
Change-Id: Ib6cbcc0010f6c76dfbf0ae2cd7ae004217405ed9
Loading
Please sign in to comment