2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-21 20:13:58 +08:00
linux-next/drivers/infiniband
Jason Gunthorpe 1eb9364ce8 IB/uverbs: Fix ordering of ucontext check in ib_uverbs_write
During disassociation the ucontext will become NULL, however due to how
the SRCU locking works the ucontext must only be examined after looking
at the ib_dev, which governs the RCU control flow.

With the wrong ordering userspace will see EINVAL instead of EIO for a
disassociated uverbs FD, which breaks rdma-core.

Cc: stable@vger.kernel.org
Fixes: 491d5c6a30 ("RDMA/uverbs: Move uncontext check before SRCU read lock")
Reported-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
2018-06-12 14:39:32 -06:00
..
core IB/uverbs: Fix ordering of ucontext check in ib_uverbs_write 2018-06-12 14:39:32 -06:00
hw IB/mlx4: Fix an error handling path in 'mlx4_ib_rereg_user_mr()' 2018-06-11 12:43:41 -06:00
sw IB/rxe: avoid double kfree skb 2018-06-11 11:02:27 -06:00
ulp IB/isert: use T10-PI check mask definitions from core layer 2018-06-04 09:19:24 -06:00
Kconfig RDMA/ucm: Mark UCM interface as BROKEN 2018-05-24 09:39:25 -06:00
Makefile IB/rdmavt: Create module framework and handle driver registration 2016-03-10 20:37:04 -05:00