1. 29 Mar, 2019 3 commits
  2. 28 Mar, 2019 20 commits
  3. 27 Mar, 2019 15 commits
  4. 26 Mar, 2019 2 commits
    • Ira Weiny's avatar
      IB/core: Ensure an invalidate_range callback on ODP MR · 4ae27444
      Ira Weiny authored
      No device supports ODP MR without an invalidate_range callback.
      
      Warn on any any device which attempts to support ODP without supplying
      this callback.
      
      Then we can remove the checks for the callback within the code.
      
      This stems from the discussion
      
      https://www.spinics.net/lists/linux-rdma/msg76460.html
      
      ...which concluded this code was no longer necessary.
      Acked-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
      Reviewed-by: default avatarHaggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      4ae27444
    • Leon Romanovsky's avatar
      RDMA/rxe: Fix slab-out-bounds access which lead to kernel crash later · a4b7013d
      Leon Romanovsky authored
      BUG: KASAN: slab-out-of-bounds in rxe_mem_init_user+0x6c1/0x740 [rdma_rxe]
      Read of size 8 at addr ffff88805c01a608 by task ib_send_bw/573
      
      CPU: 24 PID: 573 Comm: ib_send_bw Not tainted 5.0.0-rc5+ #189
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.11.0-0-g63451fca13-prebuilt.qemu-project.org 04/01/2014
      Call Trace:
       rxe_mem_init_user+0x6c1/0x740 [rdma_rxe]
       rxe_reg_user_mr+0x9b/0x110 [rdma_rxe]
       ib_uverbs_reg_mr+0x428/0x9c0 [ib_uverbs]
       ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x2b0/0x410 [ib_uverbs]
       ib_uverbs_run_method+0x79c/0x1da0 [ib_uverbs]
       rxe_mem_init_user+0x6c1/0x740 [rdma_rxe]
       rxe_reg_user_mr+0x9b/0x110 [rdma_rxe]
       ib_uverbs_reg_mr+0x428/0x9c0 [ib_uverbs]
       ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x2b0/0x410 [ib_uverbs]
       ib_uverbs_run_method+0x79c/0x1da0 [ib_uverbs]
       ib_uverbs_cmd_verbs+0x5f2/0xf20 [ib_uverbs]
       ib_uverbs_ioctl+0x202/0x310 [ib_uverbs]
       do_vfs_ioctl+0x193/0x1440
       ksys_ioctl+0x3a/0x70
       __x64_sys_ioctl+0x6f/0xb0
       do_syscall_64+0x13f/0x570
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Allocated by task 573:
       __kasan_kmalloc.constprop.5+0xc1/0xd0
       __kmalloc+0x161/0x310
       rxe_mem_alloc+0x52/0x470 [rdma_rxe]
       rxe_mem_init_user+0x113/0x740 [rdma_rxe]
       rxe_reg_user_mr+0x9b/0x110 [rdma_rxe]
       ib_uverbs_reg_mr+0x428/0x9c0 [ib_uverbs]
       ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0x2b0/0x410 [ib_uverbs]
       ib_uverbs_run_method+0x79c/0x1da0 [ib_uverbs]
       ib_uverbs_cmd_verbs+0x5f2/0xf20 [ib_uverbs]
       ib_uverbs_ioctl+0x202/0x310 [ib_uverbs]
       do_vfs_ioctl+0x193/0x1440
       ksys_ioctl+0x3a/0x70
       __x64_sys_ioctl+0x6f/0xb0
       do_syscall_64+0x13f/0x570
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 0:
       __kasan_slab_free+0x12e/0x180
       kfree+0x10a/0x2c0
       rcu_process_callbacks+0xa77/0x1260
       __do_softirq+0x2ad/0xacb
      
      Test scenario:
       ib_send_bw -x 1 -d rxe0 -a &
       ib_send_bw -x 1 -d rxe0 -a localhost
      
      Fixes: 8700e3e7 ("Soft RoCE driver")
      Reported-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
      Tested-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      a4b7013d