infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines
-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Wednesday, July 15, 2015 9:38 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH] infiniband:cxgb4:Fix concurrent access issue in the functionsend_mpa_replyThis fixes a concurrent access issue in the function
send_mpa_replywhen calling the non wrapper functionset_stateon the structure pointer ep's member com due to us not locking the mutex lock for this structure pointer and thus avoid concurrent access issues by here by using the wrapper version ofset_statethat properly locks the mutex lock for us.Signed-off-by Nicholas Krause <[email protected]>--- drivers/infiniband/hw/cxgb4/cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/cxgb4/cm.c +0
-0
drivers/infiniband/hw/cxgb4/cm.c static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen)
Quoted 9 lines
drivers/infiniband/hw/cxgb4/cm.c +1
-2@@ -1048,7 +1048,7 @@ static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen)skb_get (skb);t4_set_arp_err_handler (skb,NULL , arp_failure_discard); ep->mpa_skb = skb; -__state_set (&ep->com,MPA_REP_SENT ); +state_set (&ep->com,MPA_REP_SENT ); ep->snd_seq += mpalen;return c4iw_l2t_send (&ep->com.dev->rdev, skb, ep->l2t); } --
send_mpa_reply() is called with the ep mutex held. See c4iw_accept_cr().