1. 08 10月, 2018 37 次提交
  2. 06 10月, 2018 3 次提交
    • M
      net: mvpp2: Extract the correct ethtype from the skb for tx csum offload · 35f3625c
      Maxime Chevallier 提交于
      When offloading the L3 and L4 csum computation on TX, we need to extract
      the l3_proto from the ethtype, independently of the presence of a vlan
      tag.
      
      The actual driver uses skb->protocol as-is, resulting in packets with
      the wrong L4 checksum being sent when there's a vlan tag in the packet
      header and checksum offloading is enabled.
      
      This commit makes use of vlan_protocol_get() to get the correct ethtype
      regardless the presence of a vlan tag.
      
      Fixes: 3f518509 ("ethernet: Add new driver for Marvell Armada 375 network unit")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35f3625c
    • W
      yam: fix a missing-check bug · 0781168e
      Wenwen Wang 提交于
      In yam_ioctl(), the concrete ioctl command is firstly copied from the
      user-space buffer 'ifr->ifr_data' to 'ioctl_cmd' and checked through the
      following switch statement. If the command is not as expected, an error
      code EINVAL is returned. In the following execution the buffer
      'ifr->ifr_data' is copied again in the cases of the switch statement to
      specific data structures according to what kind of ioctl command is
      requested. However, after the second copy, no re-check is enforced on the
      newly-copied command. Given that the buffer 'ifr->ifr_data' is in the user
      space, a malicious user can race to change the command between the two
      copies. This way, the attacker can inject inconsistent data and cause
      undefined behavior.
      
      This patch adds a re-check in each case of the switch statement if there is
      a second copy in that case, to re-check whether the command obtained in the
      second copy is the same as the one in the first copy. If not, an error code
      EINVAL will be returned.
      Signed-off-by: NWenwen Wang <wang6495@umn.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0781168e
    • W
      net: cxgb3_main: fix a missing-check bug · 2c05d888
      Wenwen Wang 提交于
      In cxgb_extension_ioctl(), the command of the ioctl is firstly copied from
      the user-space buffer 'useraddr' to 'cmd' and checked through the
      switch statement. If the command is not as expected, an error code
      EOPNOTSUPP is returned. In the following execution, i.e., the cases of the
      switch statement, the whole buffer of 'useraddr' is copied again to a
      specific data structure, according to what kind of command is requested.
      However, after the second copy, there is no re-check on the newly-copied
      command. Given that the buffer 'useraddr' is in the user space, a malicious
      user can race to change the command between the two copies. By doing so,
      the attacker can supply malicious data to the kernel and cause undefined
      behavior.
      
      This patch adds a re-check in each case of the switch statement if there is
      a second copy in that case, to re-check whether the command obtained in the
      second copy is the same as the one in the first copy. If not, an error code
      EINVAL is returned.
      Signed-off-by: NWenwen Wang <wang6495@umn.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c05d888