diff mbox

[DOC] Enhance document of asan-use-after-return param.

Message ID 22f41484-d67d-dfa7-a5b4-03ebb783433b@suse.cz
State New
Headers show

Commit Message

Martin Liška Sept. 30, 2016, 8:17 a.m. UTC
Hello.

Even though we enable by default asan-use-after-return parameter (when -fsanitize=address is selected),
the runtime does not check use after return by default. I would consider it useful to document.

It's quite similar to -fsanitize=recover and halt_on_error=0 situation: one has to enable both
to really receive requested behavior.

Ready to be installed?
Thanks,
Martin

Comments

Jakub Jelinek Sept. 30, 2016, 8:20 a.m. UTC | #1
On Fri, Sep 30, 2016 at 10:17:45AM +0200, Martin Liška wrote:
> Even though we enable by default asan-use-after-return parameter (when -fsanitize=address is selected),
> the runtime does not check use after return by default. I would consider it useful to document.
> 
> It's quite similar to -fsanitize=recover and halt_on_error=0 situation: one has to enable both
> to really receive requested behavior.
> 
> Ready to be installed?
> Thanks,
> Martin

> >From 165a90fb7a8a91e9196f641ff644b38c4e1b7f94 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Fri, 30 Sep 2016 10:07:17 +0200
> Subject: [PATCH] Enhance document of asan-use-after-return param.
> 
> gcc/ChangeLog:
> 
> 2016-09-30  Martin Liska  <mliska@suse.cz>
> 
> 	* doc/invoke.texi: Document asan-use-after-return that
> 	it's disabled by default in runtime.

Ok, thanks.

	Jakub
diff mbox

Patch

From 165a90fb7a8a91e9196f641ff644b38c4e1b7f94 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 30 Sep 2016 10:07:17 +0200
Subject: [PATCH] Enhance document of asan-use-after-return param.

gcc/ChangeLog:

2016-09-30  Martin Liska  <mliska@suse.cz>

	* doc/invoke.texi: Document asan-use-after-return that
	it's disabled by default in runtime.
---
 gcc/doc/invoke.texi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8a84e4f..0121560 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10034,6 +10034,10 @@  is enabled by default when using @option{-fsanitize=address} option.
 To disable use-after-return detection use 
 @option{--param asan-use-after-return=0}.
 
+Note: The check is disabled by default at runtime.  To enable the check,
+you should set environment variable @env{ASAN_OPTIONS} to
+@code{detect_stack_use_after_return=1}.
+
 @item asan-instrumentation-with-call-threshold
 If number of memory accesses in function being instrumented
 is greater or equal to this number, use callbacks instead of inline checks.
-- 
2.9.2