Skip to content

Commit

Permalink
rds: avoid version downgrade to legitimate newer peer connections
Browse files Browse the repository at this point in the history
Connections with legitimate tos values can get into usual connection
race. It can result in consumer reject. We don't want tos value or
protocol version to be demoted for such connections otherwise
piers would end up different tos values which can results in
no connection. Example a peer initiated connection with say
tos 8 while usual connection racing can get downgraded to tos 0
which is not desirable.

Patch fixes above issue introduced by commit
commit d021fab ("rds: rdma: add consumer reject")

Reported-by: Yanjun Zhu <yanjun.zhu@oracle.com>
Tested-by: Yanjun Zhu <yanjun.zhu@oracle.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
  • Loading branch information
Santosh Shilimkar committed Jul 10, 2019
1 parent fc640d4 commit dc205a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/rds/rdma_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
((*err) <= RDS_RDMA_REJ_INCOMPAT))) {
pr_warn("RDS/RDMA: conn <%pI6c, %pI6c> rejected, dropping connection\n",
&conn->c_laddr, &conn->c_faddr);
conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION;
conn->c_tos = 0;

if (!conn->c_tos)
conn->c_proposed_version = RDS_PROTOCOL_COMPAT_VERSION;

rds_conn_drop(conn);
}
rdsdebug("Connection rejected: %s\n",
Expand Down

0 comments on commit dc205a8

Please sign in to comment.