1. 12 Jul, 2023 2 commits
    • Gustavo A. R. Silva's avatar
      sparc: openpromio: Address -Warray-bounds warning · 221a4b56
      Gustavo A. R. Silva authored
      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/322Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      221a4b56
    • Gustavo A. R. Silva's avatar
      reiserfs: Replace one-element array with flexible-array member · 76d2ceda
      Gustavo A. R. Silva authored
      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 direntry_uarea structure, and refactor the rest of the code,
      accordingly.
      
      Worth mentioning is that before these changes, the original implementation
      was returning two-too many bytes in function direntry_create_vi():
      
      fs/reiserfs/item_ops.c:464:     int size = sizeof(struct direntry_uarea);
      ...
      fs/reiserfs/item_ops.c-490-     size += (dir_u->entry_count * sizeof(short));
      ...
      fs/reiserfs/item_ops.c-517-     return size;
      
      Link: https://github.com/KSPP/linux/issues/79
      Link: https://github.com/KSPP/linux/issues/290Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      76d2ceda
  2. 09 Jul, 2023 10 commits
  3. 08 Jul, 2023 28 commits