WSL2-Linux-Kernel/include/uapi
Arnd Bergmann 17bdba70a8 autofs: use flexible array in ioctl structure
commit e910c8e3aa upstream.

Commit df8fc4e934 ("kbuild: Enable -fstrict-flex-arrays=3") introduced a warning
for the autofs_dev_ioctl structure:

In function 'check_name',
    inlined from 'validate_dev_ioctl' at fs/autofs/dev-ioctl.c:131:9,
    inlined from '_autofs_dev_ioctl' at fs/autofs/dev-ioctl.c:624:8:
fs/autofs/dev-ioctl.c:33:14: error: 'strchr' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
   33 |         if (!strchr(name, '/'))
      |              ^~~~~~~~~~~~~~~~~
In file included from include/linux/auto_dev-ioctl.h:10,
                 from fs/autofs/autofs_i.h:10,
                 from fs/autofs/dev-ioctl.c:14:
include/uapi/linux/auto_dev-ioctl.h: In function '_autofs_dev_ioctl':
include/uapi/linux/auto_dev-ioctl.h:112:14: note: source object 'path' of size 0
  112 |         char path[0];
      |              ^~~~

This is easily fixed by changing the gnu 0-length array into a c99
flexible array. Since this is a uapi structure, we have to be careful
about possible regressions but this one should be fine as they are
equivalent here. While it would break building with ancient gcc versions
that predate c99, it helps building with --std=c99 and -Wpedantic builds
in user space, as well as non-gnu compilers. This means we probably
also want it fixed in stable kernels.

Cc: stable@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230523081944.581710-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-23 13:47:33 +02:00
..
asm-generic signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-06-09 10:22:48 +02:00
drm drm/fourcc: Add packed 10bit YUV 4:2:0 format 2022-12-31 13:14:10 +01:00
linux autofs: use flexible array in ioctl structure 2023-07-23 13:47:33 +02:00
misc habanalabs: fix resetting args in wait for CS IOCTL 2021-09-29 12:18:48 +03:00
mtd mtd: add OTP (one-time-programmable) erase ioctl 2021-03-28 19:24:54 +02:00
rdma RDMA/mlx5: Don't compare mkey tags in DEVX indirect mkey 2022-10-26 12:35:03 +02:00
scsi scsi: fc: Add EDC ELS definition 2021-08-24 22:56:33 -04:00
sound ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg 2023-05-30 13:55:33 +01:00
video
xen
Kbuild