This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: v2 [PATCH 0/X] Introduce HWASAN sanitizer to GCC
- From: Matthew Malcomson <Matthew dot Malcomson at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>, "rguenther at suse dot de" <rguenther at suse dot de>, James Greenhalgh <James dot Greenhalgh at arm dot com>, "kcc at google dot com" <kcc at google dot com>, "law at redhat dot com" <law at redhat dot com>, "dvyukov at google dot com" <dvyukov at google dot com>, Martin Liska <mliska at suse dot cz>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, "ian at airs dot com" <ian at airs dot com>, "dodji at redhat dot com" <dodji at redhat dot com>, "joseph at codesourcery dot com" <joseph at codesourcery dot com>, "jakub at redhat dot com" <jakub at redhat dot com>
- Date: Mon, 11 Nov 2019 16:16:29 +0000
- Subject: Re: v2 [PATCH 0/X] Introduce HWASAN sanitizer to GCC
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vUbWr6Ti70JwubmgSJ4M01RtV6tFFzgUJeyb0CP/jQk=; b=EqVll/M6dPK5L7XUUisZHIMVJdeYUeHbo6cjqp/DMaKTAXSriC3o/5BpyXfjlEjm2m69OimsWCTnQ7eczFw+1x+AHYCAM3RzOViobK+E9PLq+NgvkWsFBk0new9PvkAfEXRFTY1yKKKoTHjozGSRkT49sayhg3OFYsO9NIiaMNuf4mGO7Fg9ADq4foj/Yjjn4R/J5zYa2IHyS94K9thtXF4wzbVJWoJqQ/owK/2mI1ngyTuwuEFYpWNUv73yAKK72mq6RGxqawXXt9G2iGckdwSe5E3iVzmNHKapjNethlxYAcY85dQZ5hs0+Ajh39cwxNPpAxUzGfAOTDUlnWMDOg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YGWADmrl6SV8FIzWYLt1r+W3+/nENgORHiKnm4DvYO0zebjLZVOqcAxMgP5JaA3ITo/1xrHd3Rw39dCjpQ7u6hdEain8B01Nu1wWg+oW09t3/vl4Atn2L/HWGb57tQ8xxSwRt5iZIqWrVNtT3jH/IwU6X0W2LMwuakRcj1MJVVk/p487zF4U8G0ohI1IcOQCmdQXY3DE2oIf8H0RfVJtOo0bTZrghEGLfEaWKWNvXTtBwH/zQ+rXqW5Fx8bARLOuAiVp2Z7Qh1qm5ZZl022jD0AQdeblx7qI/phDraDG5G0e7Uq88OPKPw1SmKecE5G1CPlU0q50QMvNxsXYLcE3Iw==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Matthew dot Malcomson at arm dot com;
- References: <157295142743.27946.1142544630216676787.scripted-patch-series@arm.com> <157314942095.11768.9327337107668665983.scripted-patch-series@arm.com> <ac0cf08e-405e-6719-9aac-b467756011cd@arm.com>
On 11/11/2019 16:13, Matthew Malcomson wrote:
> On 07/11/2019 18:37, Matthew Malcomson wrote:
>> I have rebased this series onto Martin Liska's patches that take the most
>> recent libhwasan from upstream LLVM.
>> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00340.html
>>
>> I've also cleared up some nomenclature (I had previously used the word 'colour'
>> a few times instead of the word 'tag' and that clashes with other descriptions)
>> and based the patch series off a more recent GCC revision (r277678).
>>
>> There's an ongoing discussion on whether to have __SANITIZER_ADDRESS__, or
>> __SANITIZER_HWADDRESS__, but I'm keeping that discussion to the existing
>> thread.
>>
>> Similarly there's still the question around C++ exceptions that I'm keeping to
>> the existing thread (on the first patch series).
>>
>>
>> NOTE:
>> Unfortunately, there's a bug in the more recent version of GCC I rebased
>> onto.
>> Hwasan catches this when bootstrapping, which means bootstrapping with hwasan
>> fails.
>> I'm working on tracking the bug down now, but sending this series upstream
>> for visibility while that happens.
>>
>> Bugzilla link:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92410
>>
>> Entire patch series attached to cover letter.
>>
>
> It seems that PR 92410 is a little more extensive than it originally
> looked (in fixing it I saw instances of the same basic problem elsewhere
> too).
>
> Just in case anyone wants to take a look at this HWASAN series in the
> meantime there are two ways:
>
> 1) Bootstrap with hwasan not crashing on error.
>
> 2) Apply the last patch I posted on
> http://pdtlreviewboard.cambridge.arm.com/r/12149/
Oops -- clipboard didn't have what I thought it did.
I meant https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92410 here.
>
>
> Number 1 requires the patch below and to run make with HWASAN_OPTIONS
> set to "halt_on_error=0 exitcode=0".
>
> diff --git a/config/bootstrap-hwasan.mk b/config/bootstrap-hwasan.mk
> index 91989f4..3672b91 100644
> --- a/config/bootstrap-hwasan.mk
> +++ b/config/bootstrap-hwasan.mk
> @@ -4,8 +4,8 @@
> # breaks. Running with a random frame tag gives approx. 50% chance of
> # bootstrap comparison diff in libiberty/alloca.c.
>
> -STAGE2_CFLAGS += -fsanitize=hwaddress --param hwasan-random-frame-tag=0
> -STAGE3_CFLAGS += -fsanitize=hwaddress --param hwasan-random-frame-tag=0
> +STAGE2_CFLAGS += -fsanitize-recover=hwaddress -fsanitize=hwaddress
> --param hwasan-random-frame-tag=0
> +STAGE3_CFLAGS += -fsanitize-recover=hwaddress -fsanitize=hwaddress
> --param hwasan-random-frame-tag=0
> POSTSTAGE1_LDFLAGS += -fsanitize=hwaddress -static-libhwasan \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/hwasan/ \
>
>
>
>
> Number 2 option avoids the current problem, but causes two extra
> testsuite failures (unrelated to hwasan) in gcc.dg/fold-eqandshift-1.c
> and gcc.c-torture/compile/pr32482.c.
> These are existing bugs that a new `assert` catches.
>