linux-stable/include
Arnd Bergmann bb6e04a173 kasan: use internal prototypes matching gcc-13 builtins
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);

The two problems are:

 - Addresses are passes as 'unsigned long' in the kernel, but gcc-13
   expects a 'void *'.

 - sizes meant to use a signed ssize_t rather than size_t.

Change all the prototypes to match these.  Using 'void *' consistently for
addresses gets rid of a couple of type casts, so push that down to the
leaf functions where possible.

This now passes all randconfig builds on arm, arm64 and x86, but I have
not tested it on the other architectures that support kasan, since they
tend to fail randconfig builds in other ways.  This might fail if any of
the 32-bit architectures expect a 'long' instead of 'int' for the size
argument.

The __asan_allocas_unpoison() function prototype is somewhat weird, since
it uses a pointer for 'stack_top' and an size_t for 'stack_bottom'.  This
looks like it is meant to be 'addr' and 'size' like the others, but the
implementation clearly treats them as 'top' and 'bottom'.

Link: https://lkml.kernel.org/r/20230509145735.9263-2-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-06-09 16:25:19 -07:00
..
acpi Power management updates for 6.4-rc1 2023-04-25 18:44:10 -07:00
asm-generic vmlinux.lds.h: Discard .note.gnu.property section 2023-05-16 06:30:50 -07:00
clocksource
crypto This update includes the following changes: 2023-04-26 08:32:52 -07:00
drm drm: fix drmm_mutex_init() 2023-05-22 12:23:50 +02:00
dt-bindings - mailbox api: allow direct registration to a channel 2023-05-07 10:17:33 -07:00
keys
kunit
kvm s390: 2023-05-01 12:06:20 -07:00
linux kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
math-emu
media media: dvb-core: Fix use-after-free due to race at dvb_register_device() 2023-05-14 06:30:58 +01:00
memory
misc
net net/handshake: Enable the SNI extension to work properly 2023-05-24 22:05:24 -07:00
pcmcia
ras
rdma
rv
scsi Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
soc Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
sound ASoC: Intel: avs: Account for UID of ACPI device 2023-05-22 11:18:24 +01:00
target
trace NFSD 6.4 Release Notes 2023-04-29 11:04:14 -07:00
uapi cachestat: implement cachestat syscall 2023-06-09 16:25:16 -07:00
ufs scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc() 2023-05-16 21:07:26 -04:00
vdso
video
xen