From: Julian Zboril <julian.zboril@fau.de>
To: gcc-help@gcc.gnu.org
Subject: Missing __asan_stack_free in Custom KASAN Implementation
Date: Wed, 20 Mar 2024 16:49:01 +0100 [thread overview]
Message-ID: <e4ce9fdd-b401-45e5-abb7-e23475160f45@fau.de> (raw)
Hello,
I am currently working on a Kernel Address Sanitizer implementation for
my universities teaching operating system. My current goal is getting
use-after-return detection to work (with a fake stack allocator). While
gcc inserts the __asan_stack_malloc* calls seemingly fine, it does not
add any __asan_stack_free* calls at all.
It also does not detect my artificial example, which consists of
returning a pointer to a (constant) integer on the stack. This causes an
exception to be thrown, but no detection by the address sanitizer. It is
possible that this is a direct consequence of my issue with
__asan_stack_free*, as the allocator fills up quite quickly when the
stack frames are not freed.
These are the (ASan-related) flags I use for compilation:
-fsanitize=kernel-address -DKASAN_OFFSET=$(KASAN_OFFSET) -DKASAN=1
--param asan-stack=1 --param asan-use-after-return=1 --param
asan-instrumentation-with-call-threshold=0
-fsanitize-address-use-after-scope -fasan-shadow-offset=$(KASAN_OFFSET)
The custom asan-runtime is built as an external static library archive.
Any help or ideas would be greatly appreciated.
Greetings,
Julian
reply other threads:[~2024-03-20 15:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4ce9fdd-b401-45e5-abb7-e23475160f45@fau.de \
--to=julian.zboril@fau.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).