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]
Date:	Thu, 14 Jan 2016 15:24:33 +0100
From:	Dmitry Vyukov <dvyukov@...gle.com>
To:	"Kirill A. Shutemov" <kirill@...temov.name>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	David Drysdale <drysdale@...gle.com>,
	Kees Cook <keescook@...gle.com>,
	Quentin Casasnovas <quentin.casasnovas@...cle.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	Vegard Nossum <vegard.nossum@...cle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Tavis Ormandy <taviso@...gle.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	syzkaller <syzkaller@...glegroups.com>,
	Kostya Serebryany <kcc@...gle.com>,
	Alexander Potapenko <glider@...gle.com>,
	Andrey Ryabinin <ryabinin.a.a@...il.com>
Subject: Re: [PATCH v2] kernel: add kcov code coverage

On Thu, Jan 14, 2016 at 1:49 PM, Kirill A. Shutemov
<kirill@...temov.name> wrote:
> On Thu, Jan 14, 2016 at 01:21:27PM +0100, Dmitry Vyukov wrote:
>> >> Alternatively, you can try to bulk disable instrumentation of
>> >> everything related to boot process (by adding KCOV_INSTRUMENT := n to
>> >> the Makefile). Most likely it is due to instrumentation. If it helps,
>> >> try to bisect the the guilty files.
>> >
>> > Okay, I'll try.
>>
>>
>> I've tried with exactly your gcc revision and your config and VM boots fine...
>>
>> For me it prints 4 CPUs:
>> [    0.193348] smpboot: Total of 4 processors activated
>> so it is probably fine :)
>>
>> I am almost sure that the root cause is kcov instrumentation is some
>> inappropriate place. I've fixed such symptoms several times by
>> disabling instrumentation in various places.
>
> Okay, I found it. The patch below helps.
>
> But I wounder how safe this thing is. :-/
>
> Looks like -fsanitize-coverage=trace-pc doesn't play well when we change
> calling convention for the compilation unit, as we do for hweight.o.
> See CONFIG_ARCH_HWEIGHT_CFLAGS.
>
> What else should we expect from GCC in this mode?

Thank you very much tracking this down. Mailed v3 of the patch with this fix.
GCC inserts callbacks into every basic block of code. This is OK for
most of the code. But for some very special code it breaks as here. We
could change gcc to call a different callback in such cases, but it is
probably not worth it for the singe case.


> diff --git a/lib/Makefile b/lib/Makefile
> index 58043870dbd2..56171482f99f 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -15,6 +15,7 @@ KCOV_INSTRUMENT_rbtree.o := n
>  KCOV_INSTRUMENT_list_debug.o := n
>  KCOV_INSTRUMENT_debugobjects.o := n
>  KCOV_INSTRUMENT_dynamic_debug.o := n
> +KCOV_INSTRUMENT_hweight.o := n
>
>  lib-y := ctype.o string.o vsprintf.o cmdline.o \
>          rbtree.o radix-tree.o dump_stack.o timerqueue.o\
> --
>  Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ