1. 27 9月, 2021 1 次提交
  2. 09 9月, 2021 1 次提交
  3. 08 9月, 2021 1 次提交
  4. 21 7月, 2021 1 次提交
  5. 02 7月, 2021 1 次提交
  6. 25 6月, 2021 7 次提交
  7. 22 6月, 2021 1 次提交
    • K
      ibmvnic: Use strscpy() instead of strncpy() · ef2c3dda
      Kees Cook 提交于
      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: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef2c3dda
  8. 15 6月, 2021 1 次提交
  9. 13 6月, 2021 2 次提交
    • L
      ibmvnic: fix kernel build warnings in build_hdr_descs_arr · 73214a69
      Lijun Pan 提交于
      Fix the following kernel build warnings:
      drivers/net/ethernet/ibm/ibmvnic.c:1516: warning: Function parameter or member 'skb' not described in 'build_hdr_descs_arr'
      drivers/net/ethernet/ibm/ibmvnic.c:1516: warning: Function parameter or member 'indir_arr' not described in 'build_hdr_descs_arr'
      drivers/net/ethernet/ibm/ibmvnic.c:1516: warning: Excess function parameter 'txbuff' description in 'build_hdr_descs_arr'
      Signed-off-by: NLijun Pan <lijunp213@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73214a69
    • L
      ibmvnic: fix kernel build warning · 822ebc2c
      Lijun Pan 提交于
      drivers/net/ethernet/ibm/ibmvnic.c: In function ‘adapter_state_to_string’:
      drivers/net/ethernet/ibm/ibmvnic.c:855:2: warning: enumeration value ‘VNIC_DOWN’ not handled in switch [-Wswitch]
        855 |  switch (state) {
            |  ^~~~~~
      drivers/net/ethernet/ibm/ibmvnic.c: In function ‘reset_reason_to_string’:
      drivers/net/ethernet/ibm/ibmvnic.c:1958:2: warning: enumeration value ‘VNIC_RESET_PASSIVE_INIT’ not handled in switch [-Wswitch]
       1958 |  switch (reason) {
            |  ^~~~~~
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NLijun Pan <lijunp213@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      822ebc2c
  10. 12 6月, 2021 1 次提交
    • L
      ibmvnic: fix kernel build warning in strncpy · 0b217d3d
      Lijun Pan 提交于
      drivers/net/ethernet/ibm/ibmvnic.c: In function ‘handle_vpd_rsp’:
      drivers/net/ethernet/ibm/ibmvnic.c:4393:3: warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
       4393 |   strncpy((char *)adapter->fw_version, "N/A", 3 * sizeof(char));
            |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: NLijun Pan <lijunp213@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b217d3d
  11. 11 6月, 2021 2 次提交
  12. 21 5月, 2021 1 次提交
  13. 15 4月, 2021 3 次提交
  14. 14 4月, 2021 3 次提交
  15. 13 4月, 2021 2 次提交
  16. 06 4月, 2021 1 次提交
  17. 06 3月, 2021 1 次提交
    • J
      ibmvnic: remove excessive irqsave · 69cdb794
      Junlin Yang 提交于
      ibmvnic_remove locks multiple spinlocks while disabling interrupts:
      spin_lock_irqsave(&adapter->state_lock, flags);
      spin_lock_irqsave(&adapter->rwi_lock, flags);
      
      As reported by coccinelle, the second _irqsave() overwrites the value
      saved in 'flags' by the first _irqsave(),   therefore when the second
      _irqrestore() comes,the value in 'flags' is not valid,the value saved
      by the first _irqsave() has been lost.
      This likely leads to IRQs remaining disabled. So remove the second
      _irqsave():
      spin_lock_irqsave(&adapter->state_lock, flags);
      spin_lock(&adapter->rwi_lock);
      
      Generated by: ./scripts/coccinelle/locks/flags.cocci
      ./drivers/net/ethernet/ibm/ibmvnic.c:5413:1-18:
      ERROR: nested lock+irqsave that reuses flags from line 5404.
      
      Fixes: 4a41c421 ("ibmvnic: serialize access to work queue on remove")
      Signed-off-by: NJunlin Yang <yangjunlin@yulong.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69cdb794
  18. 05 3月, 2021 1 次提交
    • J
      ibmvnic: always store valid MAC address · 67eb2114
      Jiri Wiesner 提交于
      The last change to ibmvnic_set_mac(), 8fc3672a, meant to prevent
      users from setting an invalid MAC address on an ibmvnic interface
      that has not been brought up yet. The change also prevented the
      requested MAC address from being stored by the adapter object for an
      ibmvnic interface when the state of the ibmvnic interface is
      VNIC_PROBED - that is after probing has finished but before the
      ibmvnic interface is brought up. The MAC address stored by the
      adapter object is used and sent to the hypervisor for checking when
      an ibmvnic interface is brought up.
      
      The ibmvnic driver ignoring the requested MAC address when in
      VNIC_PROBED state caused LACP bonds (bonds in 802.3ad mode) with more
      than one slave to malfunction. The bonding code must be able to
      change the MAC address of its slaves before they are brought up
      during enslaving. The inability of kernels with 8fc3672a to set
      the MAC addresses of bonding slaves is observable in the output of
      "ip address show". The MAC addresses of the slaves are the same as
      the MAC address of the bond on a working system whereas the slaves
      retain their original MAC addresses on a system with a malfunctioning
      LACP bond.
      
      Fixes: 8fc3672a ("ibmvnic: fix ibmvnic_set_mac")
      Signed-off-by: NJiri Wiesner <jwiesner@suse.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      67eb2114
  19. 04 3月, 2021 1 次提交
  20. 02 3月, 2021 1 次提交
  21. 25 2月, 2021 1 次提交
    • S
      ibmvnic: fix a race between open and reset · 8f1c0fd2
      Sukadev Bhattiprolu 提交于
      __ibmvnic_reset() currently reads the adapter->state before getting the
      rtnl and saves that state as the "target state" for the reset. If this
      read occurs when adapter is in PROBED state, the target state would be
      PROBED.
      
      Just after the target state is saved, and before the actual reset process
      is started (i.e before rtnl is acquired) if we get an ibmvnic_open() call
      we would move the adapter to OPEN state.
      
      But when the reset is processed (after ibmvnic_open()) drops the rtnl),
      it will leave the adapter in PROBED state even though we already moved
      it to OPEN.
      
      To fix this, use the RTNL to improve serialization when reading/updating
      the adapter state. i.e determine the target state of a reset only after
      getting the RTNL. And if a reset is in progress during an open, simply
      set the target state of the adapter and let the reset code finish the
      open (like we currently do if failover is pending).
      
      One twist to this serialization is if the adapter state changes when we
      drop the RTNL to update the link state. Account for this by checking if
      there was an intervening open and update the target state for the reset
      accordingly (see new comments in the code). Note that only the reset
      functions and ibmvnic_open() can set the adapter to OPEN state and this
      must happen under rtnl.
      
      Fixes: 7d7195a0 ("ibmvnic: Do not process device remove during device reset")
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Reviewed-by: NDany Madden <drt@linux.ibm.com>
      Link: https://lore.kernel.org/r/20210224050229.1155468-1-sukadev@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      8f1c0fd2
  22. 17 2月, 2021 1 次提交
  23. 16 2月, 2021 5 次提交