summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/rtrs/rtrs-clt.h
diff options
context:
space:
mode:
authorMd Haris Iqbal <haris.iqbal@cloud.ionos.com>2021-02-12 16:45:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-04 13:38:08 +0300
commitc6f81f3a9c40b01e2b2a566ca8f4eccabdfbcbe3 (patch)
treeffd1c6e273761ec18b6efc662f35b74fb05c28be /drivers/infiniband/ulp/rtrs/rtrs-clt.h
parent51ea7da47b7c16b5e5e3684f8706e404408cc2d6 (diff)
downloadlinux-c6f81f3a9c40b01e2b2a566ca8f4eccabdfbcbe3.tar.xz
RDMA/rtrs: Only allow addition of path to an already established session
[ Upstream commit 03e9b33a0fd677f554b03352646c13459bf60458 ] While adding a path from the client side to an already established session, it was possible to provide the destination IP to a different server. This is dangerous. This commit adds an extra member to the rtrs_msg_conn_req structure, named first_conn; which is supposed to notify if the connection request is the first for that session or not. On the server side, if a session does not exist but the first_conn received inside the rtrs_msg_conn_req structure is 1, the connection request is failed. This signifies that the connection request is for an already existing session, and since the server did not find one, it is an wrong connection request. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Link: https://lore.kernel.org/r/20210212134525.103456-3-jinpu.wang@cloud.ionos.com Signed-off-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com> Reviewed-by: Lutz Pogrell <lutz.pogrell@cloud.ionos.com> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/infiniband/ulp/rtrs/rtrs-clt.h')
-rw-r--r--drivers/infiniband/ulp/rtrs/rtrs-clt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.h b/drivers/infiniband/ulp/rtrs/rtrs-clt.h
index 167acd3c90fc..22da5d50c22c 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.h
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.h
@@ -142,6 +142,7 @@ struct rtrs_clt_sess {
int max_send_sge;
u32 flags;
struct kobject kobj;
+ u8 for_new_clt;
struct rtrs_clt_stats *stats;
/* cache hca_port and hca_name to display in sysfs */
u8 hca_port;