1. 22 Jun, 2021 38 commits
  2. 21 Jun, 2021 2 commits
    • Kees Cook's avatar
      ibmvnic: Use strscpy() instead of strncpy() · ef2c3dda
      Kees Cook authored
      Since these strings are expected to be NUL-terminated and the buffers
      are exactly sized (in vnic_client_data_len()) with no padding, strncpy()
      can be safely replaced with strscpy() here, as strncpy() on
      NUL-terminated string is considered deprecated[1]. This has the
      side-effect of silencing a -Warray-bounds warning due to the compiler
      being confused about the vlcd incrementing:
      
      In file included from ./include/linux/string.h:253,
                       from ./include/linux/bitmap.h:10,
                       from ./include/linux/cpumask.h:12,
                       from ./include/linux/mm_types_task.h:14,
                       from ./include/linux/mm_types.h:5,
                       from ./include/linux/buildid.h:5,
                       from ./include/linux/module.h:14,
                       from drivers/net/ethernet/ibm/ibmvnic.c:35:
      In function '__fortify_strncpy',
          inlined from 'vnic_add_client_data' at drivers/net/ethernet/ibm/ibmvnic.c:3919:2:
      ./include/linux/fortify-string.h:39:30: warning: '__builtin_strncpy' offset 12 from the object at 'v
      lcd' is out of the bounds of referenced subobject 'name' with type 'char[]' at offset 12 [-Warray-bo
      unds]
         39 | #define __underlying_strncpy __builtin_strncpy
            |                              ^
      ./include/linux/fortify-string.h:51:9: note: in expansion of macro '__underlying_strncpy'
         51 |  return __underlying_strncpy(p, q, size);
            |         ^~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/ibm/ibmvnic.c: In function 'vnic_add_client_data':
      drivers/net/ethernet/ibm/ibmvnic.c:3883:7: note: subobject 'name' declared here
       3883 |  char name[];
            |       ^~~~
      
      [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
      
      Cc: Dany Madden <drt@linux.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
      Cc: Thomas Falcon <tlfalcon@linux.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef2c3dda
    • Guillaume Nault's avatar
      net: handle ARPHRD_IP6GRE in dev_is_mac_header_xmit() · a3fa449f
      Guillaume Nault authored
      Similar to commit 3b707c30 ("net: dev_is_mac_header_xmit() true for
      ARPHRD_RAWIP"), add ARPHRD_IP6GRE to dev_is_mac_header_xmit(), to make
      ip6gre compatible with act_mirred and __bpf_redirect().
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3fa449f