lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200501122312.GA3762@hirez.programming.kicks-ass.net>
Date:   Fri, 1 May 2020 14:23:12 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        the arch/x86 maintainers <x86@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Kees Cook <keescook@...omium.org>
Subject: Re: Remaining randconfig objtool warnings, linux-next-20200428

On Wed, Apr 29, 2020 at 02:18:46PM -0500, Josh Poimboeuf wrote:
> On Tue, Apr 28, 2020 at 11:10:44AM -0500, Josh Poimboeuf wrote:
> > > ==> build/x86/0x2EA4CE4F_defconfig/log <==
> > > kernel/kcov.o: warning: objtool: write_comp_data()+0x1b: call to check_kcov_mode() with UACCESS enabled
> > > kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc()+0x15: call to check_kcov_mode() with UACCESS enabled
> 
> From: Josh Poimboeuf <jpoimboe@...hat.com>
> Subject: [PATCH] objtool: Add check_kcov_mode() to the uaccess safelist
> 
> check_kcov_mode() is called by write_comp_data() and
> __sanitizer_cov_trace_pc(), which are already on the uaccess safe list.
> Might as well add check_kcov_mode() to the party.

Hurmph, the actual reason it's ok is because it's notrace and doesn't
call out to other stuff, that's the reason those other two functions got
away without having user_access_save()/restore() on.

The alternative fix would be to mark that check_kcov_mode() thing as
__always_inline, it's puny anyway.

> 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@...db.de>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>

Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>

> ---
>  tools/objtool/check.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 0c732d586924..fec890547e04 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -516,6 +516,7 @@ static const char *uaccess_safe_builtin[] = {
>  	"__tsan_write16",
>  	/* KCOV */
>  	"write_comp_data",
> +	"check_kcov_mode",
>  	"__sanitizer_cov_trace_pc",
>  	"__sanitizer_cov_trace_const_cmp1",
>  	"__sanitizer_cov_trace_const_cmp2",
> -- 
> 2.21.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ