public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] sanitizer/111736 - skip ASAN for globals in alternate address-space
@ 2023-12-05 13:55 Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-12-05 13:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?

Thanks,
Richard.

	PR sanitizer/111736
	* asan.cc (asan_protect_global): Do not protect globals
	in non-generic address-space.
---
 gcc/asan.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/asan.cc b/gcc/asan.cc
index 2424cf69ef1..8d0ffb497cc 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -2291,6 +2291,8 @@ asan_protect_global (tree decl, bool ignore_decl_rtl_set_p)
       || (DECL_SECTION_NAME (decl) != NULL
 	  && !symtab_node::get (decl)->implicit_section
 	  && !section_sanitized_p (DECL_SECTION_NAME (decl)))
+      /* Don't protect variables in non-generic address-space.  */
+      || !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))
       || DECL_SIZE (decl) == 0
       || ASAN_RED_ZONE_SIZE * BITS_PER_UNIT > MAX_OFILE_ALIGNMENT
       || TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST
-- 
2.35.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sanitizer/111736 - skip ASAN for globals in alternate address-space
       [not found] <58949.123120508585105219@us-mta-61.us.mimecast.lan>
@ 2023-12-05 14:07 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2023-12-05 14:07 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Tue, Dec 05, 2023 at 02:55:05PM +0100, Richard Biener wrote:
> Bootstrapped and tested on x86_64-unknown-linux-gnu, OK?
> 
> Thanks,
> Richard.
> 
> 	PR sanitizer/111736
> 	* asan.cc (asan_protect_global): Do not protect globals
> 	in non-generic address-space.

Ok.

> diff --git a/gcc/asan.cc b/gcc/asan.cc
> index 2424cf69ef1..8d0ffb497cc 100644
> --- a/gcc/asan.cc
> +++ b/gcc/asan.cc
> @@ -2291,6 +2291,8 @@ asan_protect_global (tree decl, bool ignore_decl_rtl_set_p)
>        || (DECL_SECTION_NAME (decl) != NULL
>  	  && !symtab_node::get (decl)->implicit_section
>  	  && !section_sanitized_p (DECL_SECTION_NAME (decl)))
> +      /* Don't protect variables in non-generic address-space.  */
> +      || !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))
>        || DECL_SIZE (decl) == 0
>        || ASAN_RED_ZONE_SIZE * BITS_PER_UNIT > MAX_OFILE_ALIGNMENT
>        || TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST
> -- 
> 2.35.3

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-05 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 13:55 [PATCH] sanitizer/111736 - skip ASAN for globals in alternate address-space Richard Biener
     [not found] <58949.123120508585105219@us-mta-61.us.mimecast.lan>
2023-12-05 14:07 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).