Closed ramosian-glider closed 8 years ago
I think ASan wiki are outdated - you can simply use official GCC 4.9.2+, it has all
the necessary patches.
@Dima: should we update the instructions on obtaining the toolchain on Kasan wiki?
Reported by tetra2005x
on 2015-01-12 14:02:04
Thanks @tetra20, for quick reply, but it doesn't work :(
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ git pull
Already up-to-date
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ git branch
* asan
prasanna.k ~/gcc-git/gcc/install/bin $ ./gcc -v
Using built-in specs.
COLLECT_GCC=./gcc
COLLECT_LTO_WRAPPER=/home/prasanna.k/gcc-git/gcc/install/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --disable-bootstrap --enable-checking=no
--with-gnu-as --with-gnu-ld --with-ld=/usr/bin/ld.bfd --prefix=/home/prasanna.k/gcc-git/gcc/install
Thread model: posix
gcc version 5.0.0 20150113 (experimental) (GCC)
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ make CC=/home/prasanna.k/gcc-git/gcc/install/bin/gcc
-j20
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
CC scripts/mod/devicetable-offsets.s
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
My Observation:
$ vi Makefile + 386
386 CFLAGS_KASAN = -fsanitize=address \
387 --param asan-use-after-return=0 \
388 --param asan-globals=0 \
389 --param asan-memintrin=0 \
390 --param asan-instrumentation-with-call-threshold=0 \
391 --param asan-fixed-shadow-offset=0 \
392 -DKASAN_HOOKS
all the --param options mentioned above in Makefile are added in GCC-5.0 except `asan-fixed-shadow-offset`
Additional information:
$ gcc --param asan-use-after-return=0 global.c -o global
compilation successful
$ gcc --param asan-globals=0 global.c -o global
compilation successful
$ gcc --param asan-memintrin=0 global.c -o global
compilation successful
$ gcc --param asan-instrumentation-with-call-threshold=0 global.c -o global
compilation successful
$ gcc --param asan-fixed-shadow-offset=0 global.c -o global
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
Sources:
Kernel: https://github.com/google/kasan.git
GCC: https://github.com/gcc-mirror/gcc.git
I'm I missing something??
Any hint will be highly appreciated.
Thanks in advance.
Reported by prasanna4324
on 2015-01-13 06:16:57
'asan' branch is outdated and not supported anymore.
Use the 'kasan' branch. That branch has uptodate documentation which could be usefull
https://github.com/google/kasan/blob/kasan/Documentation/kasan.txt
Reported by Ryabinin.A.A
on 2015-01-13 07:10:27
I haven't noticed this, please update it in wiki.
Many starting users like me are facing problems in setting-up KASAN environment.
Thank you @Ryabinin.. your valuable comment helped and reduced my pain in setup.
Finally the compilation is successful :).
Reported by prasanna4324
on 2015-01-14 06:02:12
> I haven't noticed this, please update it in wiki.
Absolutely, wiki has totally rotten.
Reported by tetra2005x
on 2015-01-14 08:08:30
I can update in the evening if noone outpaces me.
Reported by tetra2005x
on 2015-01-14 08:09:35
> I can update in the evening if noone outpaces me.
It took me 4 days to do this work with all yours help.
updating wiki will really helpful to many like me :)
Thank you @tetra20 please go ahead..
Reported by prasanna4324
on 2015-01-14 09:09:03
@tetra20 you have done a good job.
But please update everything...
1. write regarding changing the branch
$ git checkout kasan
2. It is written current KASN supports only SLAB, please change it to SLUB
the below line is outdated
>"You will also need to enable SLAB allocator (General setup > Choose SLAB
>allocator) and AddressSanitizer (Kernel hacking > Memory Debugging) during
>kernel configuration"
can be updated with:
You will also need to enable SLUB allocator (General setup > Choose SLAB allocator
(SLUB (Unqueued Allocator)) and AddressSanitizer (Kernel hacking > Memory Debugging
> AddressSanitizer: runtime memory debugger ) during kernel configuration
please update the procedure
1. CONFIG_KASAN = y
2. choose b/w CONFIG_KASAN_OUTLINE or CONFIG_KASAN_INLINE
3. mention regarding advantages of enabling CONFIG_STACKTRACE and
4. finally testing 'lib/test_kasan.ko'
I think that way is very essential as mentioned in https://github.com/google/kasan/blob/kasan/Documentation/kasan.txt
Looking forward for you help and support..
Best regards :)
Reported by prasanna4324
on 2015-01-19 07:24:36
Done! Does this look saner?
Reported by tetra2005
on 2015-01-21 03:24:52
Hmmm,
this is much better @tetra20.. :)
Now any one can easily catch-up and use the KASAN.
thanks for your effort in updating this page.
Thanks & Best regards.
Reported by prasanna4324
on 2015-01-21 03:37:22
Adding Project:AddressSanitizer as part of GitHub migration.
Reported by ramosian.glider
on 2015-07-30 09:06:35
Closing this bug as obsolete. Upstream KASAN should work well (see the upstream KASAN documentation)
Originally reported on Google Code with ID 370
Reported by
prasanna4324
on 2015-01-12 02:51:04