linux-stable/arch/sparc
Gustavo A. R. Silva 221a4b56ec sparc: openpromio: Address -Warray-bounds warning
One-element arrays are deprecated, and we are replacing them with flexible
array members instead. So, replace one-element array with flexible-array
member in struct openpromio.

Address the following warning found after building (with GCC-13) sparc
with sparc64_defconfig:
In function 'opromgetprop',
    inlined from 'openprom_sunos_ioctl.isra' at drivers/sbus/char/openprom.c:312:11:
drivers/sbus/char/openprom.c:141:24: warning: array subscript 1 is above array bounds of 'char[1]' [-Warray-bounds=]
  141 |         op->oprom_array[len] = '\0';
      |         ~~~~~~~~~~~~~~~^~~~~
In file included from drivers/sbus/char/openprom.c:31:
arch/sparc/include/uapi/asm/openpromio.h: In function 'openprom_sunos_ioctl.isra':
arch/sparc/include/uapi/asm/openpromio.h:16:17: note: while referencing 'oprom_array'
   16 |         char    oprom_array[1];         /* Holds property names and values. */
      |                 ^~~~~~~~~~~

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -Warray-bounds.

This results in no differences in binary output.

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/322
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2023-07-12 13:24:20 -06:00
..
boot kbuild: factor out the common installation code into scripts/install.sh 2022-05-11 21:45:53 +09:00
configs mm/slab: rename CONFIG_SLAB to CONFIG_SLAB_DEPRECATED 2023-05-26 19:01:47 +02:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
include sparc: openpromio: Address -Warray-bounds warning 2023-07-12 13:24:20 -06:00
kernel - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00
lib bitops: wrap non-atomic bitops with a transparent macro 2022-06-30 19:52:41 -07:00
math-emu treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mm sparc32: fix lock_mm_and_find_vma() conversion 2023-06-29 20:41:24 -07:00
net net: remove skb->vlan_present 2022-11-11 18:18:05 -08:00
power
prom sparc64: Replace all non-returning strlcpy with strscpy 2023-06-14 12:04:06 -07:00
vdso treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
video arch/sparc: Add module license and description for fbdev helpers 2023-06-29 13:30:02 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
Kconfig.debug watchdog/sparc64: define HARDLOCKUP_DETECTOR_SPARC64 2023-06-19 16:25:29 -07:00
Makefile Merge drm/drm-next into drm-misc-next 2023-05-09 15:03:40 +02:00