1. 23 Aug, 2019 7 commits
    • Dag Moxnes's avatar
      net/rds: Whitelist rdma_cookie and rx_tstamp for usercopy · bf1867db
      Dag Moxnes authored
      Add the RDMA cookie and RX timestamp to the usercopy whitelist.
      
      After the introduction of hardened usercopy whitelisting
      (https://lwn.net/Articles/727322/), a warning is displayed when the
      RDMA cookie or RX timestamp is copied to userspace:
      
      kernel: WARNING: CPU: 3 PID: 5750 at
      mm/usercopy.c:81 usercopy_warn+0x8e/0xa6
      [...]
      kernel: Call Trace:
      kernel: __check_heap_object+0xb8/0x11b
      kernel: __check_object_size+0xe3/0x1bc
      kernel: put_cmsg+0x95/0x115
      kernel: rds_recvmsg+0x43d/0x620 [rds]
      kernel: sock_recvmsg+0x43/0x4a
      kernel: ___sys_recvmsg+0xda/0x1e6
      kernel: ? __handle_mm_fault+0xcae/0xf79
      kernel: __sys_recvmsg+0x51/0x8a
      kernel: SyS_recvmsg+0x12/0x1c
      kernel: do_syscall_64+0x79/0x1ae
      
      When the whitelisting feature was introduced, the memory for the RDMA
      cookie and RX timestamp in RDS was not added to the whitelist, causing
      the warning above.
      Signed-off-by: default avatarDag Moxnes <dag.moxnes@oracle.com>
      Tested-by: default avatarJenny <jenny.x.xu@oracle.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf1867db
    • Eran Ben Elisha's avatar
      net/mlx5: Fix return code in case of hyperv wrong size read · 87cade29
      Eran Ben Elisha authored
      Return code value could be non deterministic in case of wrong size read.
      With this patch, if such error occurs, set rc to be -EIO.
      
      In addition, mlx5_hv_config_common() supports reading of
      HV_CONFIG_BLOCK_SIZE_MAX bytes only, fix to early return error with
      bad input.
      
      Fixes: 913d14e8 ("net/mlx5: Add wrappers for HyperV PCIe operations")
      Reported-by: default avatarLeon Romanovsky <leon@kernel.org>
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87cade29
    • Xin Long's avatar
      net: ipv6: fix listify ip6_rcv_finish in case of forwarding · c7a42eb4
      Xin Long authored
      We need a similar fix for ipv6 as Commit 0761680d ("net: ipv4: fix
      listify ip_rcv_finish in case of forwarding") does for ipv4.
      
      This issue can be reprocuded by syzbot since Commit 323ebb61 ("net:
      use listified RX for handling GRO_NORMAL skbs") on net-next. The call
      trace was:
      
        kernel BUG at include/linux/skbuff.h:2225!
        RIP: 0010:__skb_pull include/linux/skbuff.h:2225 [inline]
        RIP: 0010:skb_pull+0xea/0x110 net/core/skbuff.c:1902
        Call Trace:
          sctp_inq_pop+0x2f1/0xd80 net/sctp/inqueue.c:202
          sctp_endpoint_bh_rcv+0x184/0x8d0 net/sctp/endpointola.c:385
          sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:80
          sctp_rcv+0x2807/0x3590 net/sctp/input.c:256
          sctp6_rcv+0x17/0x30 net/sctp/ipv6.c:1049
          ip6_protocol_deliver_rcu+0x2fe/0x1660 net/ipv6/ip6_input.c:397
          ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:438
          NF_HOOK include/linux/netfilter.h:305 [inline]
          NF_HOOK include/linux/netfilter.h:299 [inline]
          ip6_input+0xe4/0x3f0 net/ipv6/ip6_input.c:447
          dst_input include/net/dst.h:442 [inline]
          ip6_sublist_rcv_finish+0x98/0x1e0 net/ipv6/ip6_input.c:84
          ip6_list_rcv_finish net/ipv6/ip6_input.c:118 [inline]
          ip6_sublist_rcv+0x80c/0xcf0 net/ipv6/ip6_input.c:282
          ipv6_list_rcv+0x373/0x4b0 net/ipv6/ip6_input.c:316
          __netif_receive_skb_list_ptype net/core/dev.c:5049 [inline]
          __netif_receive_skb_list_core+0x5fc/0x9d0 net/core/dev.c:5097
          __netif_receive_skb_list net/core/dev.c:5149 [inline]
          netif_receive_skb_list_internal+0x7eb/0xe60 net/core/dev.c:5244
          gro_normal_list.part.0+0x1e/0xb0 net/core/dev.c:5757
          gro_normal_list net/core/dev.c:5755 [inline]
          gro_normal_one net/core/dev.c:5769 [inline]
          napi_frags_finish net/core/dev.c:5782 [inline]
          napi_gro_frags+0xa6a/0xea0 net/core/dev.c:5855
          tun_get_user+0x2e98/0x3fa0 drivers/net/tun.c:1974
          tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2020
      
      Fixes: d8269e2c ("net: ipv6: listify ipv6_rcv() and ip6_rcv_finish()")
      Fixes: 323ebb61 ("net: use listified RX for handling GRO_NORMAL skbs")
      Reported-by: syzbot+eb349eeee854e389c36d@syzkaller.appspotmail.com
      Reported-by: syzbot+4a0643a653ac375612d1@syzkaller.appspotmail.com
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c7a42eb4
    • David S. Miller's avatar
      Merge branch 'r8152-save-EEE' · aa19d1f1
      David S. Miller authored
      Hayes Wang says:
      
      ====================
      r8152: save EEE
      
      v4:
      For patch #2, remove redundant calling of "ocp_reg_write(tp, OCP_EEE_ADV, 0)".
      
      v3:
      For patch #2, fix the mistake caused by copying and pasting.
      
      v2:
      Adjust patch #1. The EEE has been disabled in the beginning of
      r8153_hw_phy_cfg() and r8153b_hw_phy_cfg(), so only check if
      it is necessary to enable EEE.
      
      Add the patch #2 for the helper function.
      
      v1:
      Saving the settings of EEE to avoid they become the default settings
      after reset_resume().
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa19d1f1
    • Hayes Wang's avatar
      r8152: add a helper function about setting EEE · e7bde56b
      Hayes Wang authored
      Add a helper function "rtl_eee_enable" for setting EEE. Besides, I
      move r8153_eee_en() and r8153b_eee_en(). And, I remove r8152b_enable_eee(),
      r8153_set_eee(), and r8153b_set_eee().
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e7bde56b
    • Hayes Wang's avatar
      r8152: saving the settings of EEE · f4a93be6
      Hayes Wang authored
      Saving the settings of EEE to avoid they become the default settings
      after reset_resume().
      Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4a93be6
    • Ben Wei's avatar
      net/ncsi: update response packet length for GCPS/GNS/GNPTS commands · 6d24e141
      Ben Wei authored
      Update response packet length for the following commands per NC-SI spec
      - Get Controller Packet Statistics
      - Get NC-SI Statistics
      - Get NC-SI Pass-through Statistics command
      Signed-off-by: default avatarBen Wei <benwei@fb.com>
      Reviewed-by: default avatarJustin Lee <justin.lee1@dell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d24e141
  2. 22 Aug, 2019 32 commits
  3. 21 Aug, 2019 1 commit