[PATCH v2 5/5] kasan: Extend KASAN mode kernel parameter

Marco Elver elver at google.com
Wed Oct 6 04:35:15 PDT 2021


On Mon, Oct 04, 2021 at 09:22PM +0100, Vincenzo Frascino wrote:
[...]
>  DECLARE_STATIC_KEY_FALSE(kasan_flag_stacktrace);
>  extern bool kasan_flag_async __ro_after_init;
> +extern bool kasan_flag_asymm __ro_after_init;
>  
>  static inline bool kasan_stack_collection_enabled(void)
>  {
>  	return static_branch_unlikely(&kasan_flag_stacktrace);
>  }
>  
> -static inline bool kasan_async_mode_enabled(void)
> +static inline bool kasan_async_fault_possible(void)
>  {
> -	return kasan_flag_async;
> +	return kasan_flag_async | kasan_flag_asymm;
> +}
> +
> +static inline bool kasan_sync_fault_possible(void)
> +{
> +	return !kasan_flag_async | kasan_flag_asymm;
>  }

Is the choice of bit-wise OR a typo? Because this should probably have
been logical OR. In this case, functionally it shouldn't matter, but is
unusual style.



More information about the linux-arm-kernel mailing list