From: "Steve Wise" <swise@opengridcomputing.com>
To: 'Nicholas Krause' <xerofoify@gmail.com>, swise@chelsio.com
Cc: dledford@redhat.com, sean.hefty@intel.com,
hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: RE: [PATCH] infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply
Date: Thu, 16 Jul 2015 09:20:19 -0500 [thread overview]
Message-ID: <000301d0bfd2$8b701440$a2503cc0$@opengridcomputing.com> (raw)
In-Reply-To: <1437014271-26020-1-git-send-email-xerofoify@gmail.com>
> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Wednesday, July 15, 2015 9:38 PM
> To: swise@chelsio.com
> Cc: dledford@redhat.com; sean.hefty@intel.com; hal.rosenstock@gmail.com; linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply
>
> This fixes a concurrent access issue in the function send_mpa_reply
> when calling the non wrapper function set_state on 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 of set_state that properly
> locks the mutex lock for us.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index 3ad8dc7..0b46b99 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -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().
WARNING: multiple messages have this Message-ID (diff)
From: "Steve Wise" <swise@opengridcomputing.com>
To: "'Nicholas Krause'" <xerofoify@gmail.com>, <swise@chelsio.com>
Cc: <dledford@redhat.com>, <sean.hefty@intel.com>,
<hal.rosenstock@gmail.com>, <linux-rdma@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply
Date: Thu, 16 Jul 2015 09:20:19 -0500 [thread overview]
Message-ID: <000301d0bfd2$8b701440$a2503cc0$@opengridcomputing.com> (raw)
In-Reply-To: <1437014271-26020-1-git-send-email-xerofoify@gmail.com>
> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Wednesday, July 15, 2015 9:38 PM
> To: swise@chelsio.com
> Cc: dledford@redhat.com; sean.hefty@intel.com; hal.rosenstock@gmail.com; linux-rdma@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply
>
> This fixes a concurrent access issue in the function send_mpa_reply
> when calling the non wrapper function set_state on 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 of set_state that properly
> locks the mutex lock for us.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
> drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index 3ad8dc7..0b46b99 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -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().
next parent reply other threads:[~2015-07-16 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1437014271-26020-1-git-send-email-xerofoify@gmail.com>
2015-07-16 14:20 ` Steve Wise [this message]
2015-07-16 14:20 ` [PATCH] infiniband:cxgb4:Fix concurrent access issue in the function send_mpa_reply Steve Wise
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000301d0bfd2$8b701440$a2503cc0$@opengridcomputing.com' \
--to=swise@opengridcomputing.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.com \
--cc=swise@chelsio.com \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.