]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/ucma: ucma_context reference leak in error path
authorShamir Rabinovitch <shamir.rabinovitch@oracle.com>
Thu, 24 Sep 2020 09:24:49 +0000 (18:24 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 09:11:49 +0000 (11:11 +0200)
commit45bba71e3f822c2976d71c3a285d5581dbebb9e1
treeac69c0582bdbcb8947b34a053503e691e21e0330
parent2d81575a4bda48981dec3d51509569fc9ae67044
RDMA/ucma: ucma_context reference leak in error path

commit ef95a90ae6f4f21990e1f7ced6719784a409e811 upstream.

Validating input parameters should be done before getting the cm_id
otherwise it can leak a cm_id reference.

Fixes: 6a21dfc0d0db ("RDMA/ucma: Limit possible option size")
Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
[iwamatsu: Backported to 4.4, 4.9 and 4.14: adjust context]
Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/ucma.c