Re: [PATCH 2/2] [v3] kasan: use internal prototypes matching gcc-13 builtins

From: Andrew Morton
Date: Fri May 12 2023 - 19:50:38 EST


On Tue, 9 May 2023 16:57:21 +0200 Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

> gcc-13 warns about function definitions for builtin interfaces
> that have a different prototype, e.g.:
>
> In file included from kasan_test.c:31:
> kasan.h:574:6: error: conflicting types for built-in function '__asan_register_globals'; expected 'void(void *, long int)' [-Werror=builtin-declaration-mismatch]
> 574 | void __asan_register_globals(struct kasan_global *globals, size_t size);
> kasan.h:577:6: error: conflicting types for built-in function '__asan_alloca_poison'; expected 'void(void *, long int)' [-Werror=builtin-declaration-mismatch]
> 577 | void __asan_alloca_poison(unsigned long addr, size_t size);
> kasan.h:580:6: error: conflicting types for built-in function '__asan_load1'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch]
> 580 | void __asan_load1(unsigned long addr);
> kasan.h:581:6: error: conflicting types for built-in function '__asan_store1'; expected 'void(void *)' [-Werror=builtin-declaration-mismatch]
> 581 | void __asan_store1(unsigned long addr);
> kasan.h:643:6: error: conflicting types for built-in function '__hwasan_tag_memory'; expected 'void(void *, unsigned char, long int)' [-Werror=builtin-declaration-mismatch]
> 643 | void __hwasan_tag_memory(unsigned long addr, u8 tag, unsigned long size);

I added cc:stable to these, but staged them for the next merge window.

Because I expect many people will compile earlier kernels many times
with gcc-13 and later, and they won't want to have to see these
warnings all the time.