objtool: Add check_kcov_mode() to the uaccess safelist
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 29 Apr 2020 19:09:04 +0000 (14:09 -0500)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 20 May 2020 13:30:43 +0000 (08:30 -0500)
check_kcov_mode() is called by write_comp_data() and
__sanitizer_cov_trace_pc(), which are already on the uaccess safe list.
It's notrace and doesn't call out to anything else, so add it to the
list too.

This fixes the following warnings:

  kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0x15: call to check_kcov_mode() with UACCESS enabled
  kernel/kcov.o: warning: objtool: write_comp_data()+0x1b: call to check_kcov_mode() with UACCESS enabled

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
tools/objtool/check.c

index e36a818a2fed18bd3c4e17b76070eff3c5c416dc..7a47ff9d39f7d3651a9b9c92f86c20b791dbd492 100644 (file)
@@ -507,6 +507,7 @@ static const char *uaccess_safe_builtin[] = {
        "__asan_report_store16_noabort",
        /* KCOV */
        "write_comp_data",
+       "check_kcov_mode",
        "__sanitizer_cov_trace_pc",
        "__sanitizer_cov_trace_const_cmp1",
        "__sanitizer_cov_trace_const_cmp2",