Then in sanitize_spec_function supposedly for "address" check SANITIZE_USER_ADDRESS bit, for "kernel-address" added there SANITIZE_KERNEL_ADDRESS, add all the incompatibility diagnostics for the new invalid combinations.
Ok.
Plus, toplev.c has e.g.: ... Now, is the same really the case for SANITIZE_KERNEL_ADDRESS?
This is a good point, KASan does not use asan_shadow_offset so this check is redundant.
I guess we still inline the shadow memory accesses to poison/unpoison stack in function prologue/epilogue, right? In that case without asan_shadow_offset we can't do anything. If it was a function call instead it would be portable to all architectures.
Stack is not supported by current KASan. My local version indeed does replace
asan_shadow_offset with function call. -Y