rxe: Fix a sleep-in-atomic bug in post_one_send
authorJia-Ju Bai <baijiaju1990@163.com>
Mon, 5 Jun 2017 12:23:40 +0000 (20:23 +0800)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Jun 2017 17:02:01 +0000 (13:02 -0400)
commit07d432bb97f19dd5e784175152f9fce3b2646133
treef7467081cde8500b5746a39cd8692f95532b22f0
parente57bb6be5e095351086d3e6de9853a0763342535
rxe: Fix a sleep-in-atomic bug in post_one_send

The driver may sleep under a spin lock, and the function call path is:
post_one_send (acquire the lock by spin_lock_irqsave)
  init_send_wqe
    copy_from_user --> may sleep

There is no flow that makes "qp->is_user" true, and copy_from_user may
cause bug when a non-user pointer is used. So the lines of copy_from_user
and check of "qp->is_user" are removed.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_verbs.c