Re: [PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

2020-01-15 Thread Daniel Axtens
>> >> +/* >> >> + * We assign some test results to these globals to make sure the tests >> >> + * are not eliminated as dead code. >> >> + */ >> >> + >> >> +int int_result; >> >> +void *ptr_result; >> > >> > These are globals, but are not static and don't have kasan_ prefix. >> > But I guess this

Re: [PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

2020-01-15 Thread Christophe Leroy
Le 15/01/2020 à 15:43, Dmitry Vyukov a écrit : On Wed, Jan 15, 2020 at 7:37 AM Daniel Axtens wrote: 3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE: memchr, memcmp and strlen. When FORTIFY_SOURCE is on, a number of functions are replaced with fortified versions,

Re: [PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

2020-01-15 Thread Dmitry Vyukov
On Wed, Jan 15, 2020 at 7:37 AM Daniel Axtens wrote: > > 3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE: > memchr, memcmp and strlen. > > When FORTIFY_SOURCE is on, a number of functions are replaced with > fortified versions, which attempt to check the sizes of the

[PATCH 1/2] kasan: stop tests being eliminated as dead code with FORTIFY_SOURCE

2020-01-14 Thread Daniel Axtens
3 KASAN self-tests fail on a kernel with both KASAN and FORTIFY_SOURCE: memchr, memcmp and strlen. When FORTIFY_SOURCE is on, a number of functions are replaced with fortified versions, which attempt to check the sizes of the operands. However, these functions often directly invoke