This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not put gimple stmt on an abnormal edge (PR sanitizer/82545).
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Oct 2017 17:57:09 +0200
- Subject: Re: [PATCH] Do not put gimple stmt on an abnormal edge (PR sanitizer/82545).
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 68FC413D1D
- References: <f559f925-0835-b19c-40f6-571b31a6cee4@suse.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Oct 16, 2017 at 10:15:04PM +0200, Martin Liška wrote:
> Hi.
>
> As discussed with Jakub on IRC, we should not put ASAN reporting function
> on critical edges. Can that potentially lead to a missed use-after-scope,
> but I guess it's very rare.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2017-10-16 Martin Liska <mliska@suse.cz>
>
> PR sanitizer/82545
> * asan.c (asan_expand_poison_ifn): Do not put gimple stmt
> on an abnormal edge.
>
> gcc/testsuite/ChangeLog:
>
> 2017-10-16 Martin Liska <mliska@suse.cz>
>
> PR sanitizer/82545
> * gcc.dg/asan/pr82545.c: New test.
Ok, with a nit:
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/asan/pr82545.c
> @@ -0,0 +1,15 @@
> +/* PR sanitizer/82545. */
> +/* { dg-do compile } */
> +
> +extern void c(int);
> +extern void d(void);
> +
> +void a(void) {
> + {
> + int b;
> + &b;
> + __builtin_setjmp(0);
Please call __builtin_setjmp with a valid argument in a global var,
like:
void *buf[5];
...
__builtin_setjmp(buf);
> + c(b);
> + }
> + d();
> +}
>
Jakub