xen/gntalloc: Replace UAPI 1-element array
authorKees Cook <keescook@chromium.org>
Tue, 6 Feb 2024 17:03:24 +0000 (09:03 -0800)
committerJuergen Gross <jgross@suse.com>
Tue, 13 Feb 2024 08:06:48 +0000 (09:06 +0100)
commitbf5802238dc181b1f7375d358af1d01cd72d1c11
tree82870de17d881908450fe5d78509b1dea56c8874
parentb0f2f82c9c16427722b8782371c2efe82b1f815c
xen/gntalloc: Replace UAPI 1-element array

Without changing the structure size (since it is UAPI), add a proper
flexible array member, and reference it in the kernel so that it will
not be trip the array-bounds sanitizer[1].

Link: https://github.com/KSPP/linux/issues/113
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20240206170320.work.437-kees@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/gntalloc.c
include/uapi/xen/gntalloc.h