1. 25 8月, 2020 3 次提交
  2. 21 8月, 2020 1 次提交
  3. 04 8月, 2020 1 次提交
  4. 01 8月, 2020 1 次提交
  5. 28 7月, 2020 1 次提交
    • A
      qed: fix the allocation of the chains with an external PBL · 1775da47
      Alexander Lobakin 提交于
      Dan reports static checker warning:
      
      "The patch 9b6ee3cf: "qed: sanitize PBL chains allocation" from Jul
      23, 2020, leads to the following static checker warning:
      
      	drivers/net/ethernet/qlogic/qed/qed_chain.c:299 qed_chain_alloc_pbl()
      	error: uninitialized symbol 'pbl_virt'.
      
      drivers/net/ethernet/qlogic/qed/qed_chain.c
         249  static int qed_chain_alloc_pbl(struct qed_dev *cdev, struct qed_chain *chain)
         250  {
         251          struct device *dev = &cdev->pdev->dev;
         252          struct addr_tbl_entry *addr_tbl;
         253          dma_addr_t phys, pbl_phys;
         254          __le64 *pbl_virt;
                      ^^^^^^^^^^^^^^^^
      [...]
         271          if (chain->b_external_pbl)
         272                  goto alloc_pages;
                              ^^^^^^^^^^^^^^^^ uninitialized
      [...]
         298                  /* Fill the PBL table with the physical address of the page */
         299                  pbl_virt[i] = cpu_to_le64(phys);
                              ^^^^^^^^^^^
      [...]
      "
      
      This issue was introduced with commit c3a321b0 ("qed: simplify
      initialization of the chains with an external PBL"), when
      chain->pbl_sp.table_virt initialization was moved up to
      qed_chain_init_params().
      Fix it by initializing pbl_virt with an already filled chain struct field.
      
      Fixes: c3a321b0 ("qed: simplify initialization of the chains with an external PBL")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAlexander Lobakin <alobakin@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1775da47
  6. 23 7月, 2020 10 次提交
  7. 22 7月, 2020 3 次提交
  8. 21 7月, 2020 12 次提交
  9. 15 7月, 2020 1 次提交
  10. 10 7月, 2020 1 次提交
  11. 08 7月, 2020 1 次提交
    • A
      net: qed: fix buffer overflow on ethtool -d · da328711
      Alexander Lobakin 提交于
      When generating debug dump, driver firstly collects all data in binary
      form, and then performs per-feature formatting to human-readable if it
      is supported.
      
      For ethtool -d, this is roughly incorrect for two reasons. First of all,
      drivers should always provide only original raw dumps to Ethtool without
      any changes.
      The second, and more critical, is that Ethtool's output buffer size is
      strictly determined by ethtool_ops::get_regs_len(), and all data *must*
      fit in it. The current version of driver always returns the size of raw
      data, but the size of the formatted buffer exceeds it in most cases.
      This leads to out-of-bound writes and memory corruption.
      
      Address both issues by adding an option to return original, non-formatted
      debug data, and using it for Ethtool case.
      
      v2:
       - Expand commit message to make it more clear;
       - No functional changes.
      
      Fixes: c965db44 ("qed: Add support for debug data collection")
      Signed-off-by: NAlexander Lobakin <alobakin@marvell.com>
      Signed-off-by: NIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da328711
  12. 07 7月, 2020 5 次提交