1. 25 7月, 2017 6 次提交
  2. 21 7月, 2017 1 次提交
  3. 20 7月, 2017 2 次提交
    • C
      net: tehuti: don't process data if it has not been copied from userspace · 1e6c22ae
      Colin Ian King 提交于
      The array data is only populated with valid information from userspace
      if cmd != SIOCDEVPRIVATE, other cases the array contains garbage on
      the stack. The subsequent switch statement acts on a subcommand in
      data[0] which could be any garbage value if cmd is SIOCDEVPRIVATE which
      seems incorrect to me.  Instead, just return EOPNOTSUPP for the case
      where cmd == SIOCDEVPRIVATE to avoid this issue.
      
      As a side note, I suspect that the original intention of the code
      was for this ioctl to work just for cmd == SIOCDEVPRIVATE (and the
      current logic is reversed). However, I don't wont to change the current
      semantics in case any userspace code relies on this existing behaviour.
      
      Detected by CoverityScan, CID#139647 ("Uninitialized scalar variable")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1e6c22ae
    • E
      NET: dwmac: Make dwmac reset unconditional · 90f522a2
      Eugeniy Paltsev 提交于
      Unconditional reset dwmac before HW init if reset controller is present.
      
      In existing implementation we reset dwmac only after second module
      probing:
      (module load -> unload -> load again [reset happens])
      
      Now we reset dwmac at every module load:
      (module load [reset happens] -> unload -> load again [reset happens])
      
      Also some reset controllers have only reset callback instead of
      assert + deassert callbacks pair, so handle this case.
      Signed-off-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90f522a2
  4. 18 7月, 2017 1 次提交
  5. 16 7月, 2017 6 次提交
  6. 15 7月, 2017 4 次提交
    • A
      liquidio: fix possible eeprom format string overflow · 56c0da49
      Arnd Bergmann 提交于
      gcc reports that the temporary buffer for computing the
      string length may be too small here:
      
      drivers/net/ethernet/cavium/liquidio/lio_ethtool.c: In function 'lio_get_eeprom_len':
      /drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:21: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
        len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:345:6: note: 'sprintf' output between 35 and 167 bytes into a destination of size 128
        len = sprintf(buf, "boardname:%s serialnum:%s maj:%lld min:%lld\n",
      
      This extends it to 192 bytes, which is certainly enough. As far
      as I could tell, there are no other constraints that require a specific
      maximum size.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      56c0da49
    • A
      net: thunder_bgx: avoid format string overflow warning · c41626ce
      Arnd Bergmann 提交于
      gcc warns that the temporary buffer might be too small here:
      
      drivers/net/ethernet/cavium/thunder/thunder_bgx.c: In function 'bgx_probe':
      drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1020:16: error: '%d' directive writing between 1 and 10 bytes into a region of size between 9 and 11 [-Werror=format-overflow=]
      sprintf(str, "BGX%d LMAC%d mode", bgx->bgx_id, lmacid);
                   ^~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1020:16: note: directive argument in the range [0, 2147483647]
      drivers/net/ethernet/cavium/thunder/thunder_bgx.c:1020:3: note: 'sprintf' output between 16 and 27 bytes into a destination of size 20
      
      This probably can't happen, but it can't hurt to make it long
      enough for the theoretical limit.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c41626ce
    • A
      bnx2x: fix format overflow warning · be9cdf1b
      Arnd Bergmann 提交于
      gcc notices that large queue numbers would overflow the queue name
      string:
      
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c: In function 'bnx2x_get_strings':
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:25: error: '%d' directive writing between 1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:25: note: directive argument in the range [0, 2147483647]
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:5: note: 'sprintf' output between 2 and 11 bytes into a destination of size 5
      
      There is a hard limit in place that makes the number at most two
      digits, so the code is fine. This changes it to use snprintf()
      to truncate instead of overflowing, which shuts up that warning.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be9cdf1b
    • A
      net: niu: fix format string overflow warning: · 73066f6c
      Arnd Bergmann 提交于
      We get a warning for the port_name string that might be longer than
      six characters if we had more than 10 ports:
      
      drivers/net/ethernet/sun/niu.c: In function 'niu_put_parent':
      drivers/net/ethernet/sun/niu.c:9563:21: error: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Werror=format-overflow=]
        sprintf(port_name, "port%d", port);
                           ^~~~~~~~
      drivers/net/ethernet/sun/niu.c:9563:21: note: directive argument in the range [0, 255]
      drivers/net/ethernet/sun/niu.c:9563:2: note: 'sprintf' output between 6 and 8 bytes into a destination of size 6
        sprintf(port_name, "port%d", port);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/sun/niu.c: In function 'niu_pci_init_one':
      drivers/net/ethernet/sun/niu.c:9538:22: error: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Werror=format-overflow=]
         sprintf(port_name, "port%d", port);
                            ^~~~~~~~
      drivers/net/ethernet/sun/niu.c:9538:22: note: directive argument in the range [0, 255]
      drivers/net/ethernet/sun/niu.c:9538:3: note: 'sprintf' output between 6 and 8 bytes into a destination of size 6
      
      While we know that the port number is small, there is no harm in
      making the format string two bytes longer to avoid the warning.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73066f6c
  7. 14 7月, 2017 7 次提交
  8. 13 7月, 2017 3 次提交
  9. 12 7月, 2017 10 次提交