On Wed, Dec 09, 2020 at 11:01:52AM +0100, Dmitry Vyukov wrote:
> Both KCOV and UBSAN use compiler instrumentation. If UBSAN detects a bug
> in KCOV, it may cause infinite recursion via printk and other common
> functions. We already don't instrument KCOV with KASAN/KCSAN for this
> reason, don't instrument it with UBSAN as well.
> 
> As a side effect this also resolves the following gcc warning:
> 
> conflicting types for built-in function '__sanitizer_cov_trace_switch';
> expected 'void(long unsigned int,  void *)' [-Wbuiltin-declaration-mismatch]
> 
> It's only reported when kcov.c is compiled with any of the sanitizers
> enabled. Size of the arguments is correct, it's just that gcc uses 'long'
> on 64-bit arches and 'long long' on 32-bit arches, while kernel type is
> always 'long long'.
> 
> Reported-by: Stephen Rothwell <s...@canb.auug.org.au>
> Suggested-by: Marco Elver <el...@google.com>
> Signed-off-by: Dmitry Vyukov <dvyu...@google.com>

Reviewed-by: Kees Cook <keesc...@chromium.org>

Thanks for chasing this down!

Andrew, can you add this to the stack of ubsan patches you're carrying,
please?

-- 
Kees Cook

Reply via email to