All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yanjun <zyjzyj2000@gmail.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	colin.king@canonical.com, linux-rdma@vger.kernel.org,
	Bob Pearson <rpearson@hpe.com>
Subject: Re: [PATCH for-next] RDMA/rxe - Respond to skb_clone failure in rxe_recv.c
Date: Wed, 14 Oct 2020 08:39:46 +0800	[thread overview]
Message-ID: <CAD=hENfGR=nLqZNON0=whxDFooG5E+Eq-ggDjrvN+6M+3F7G7w@mail.gmail.com> (raw)
In-Reply-To: <20201013184236.5231-1-rpearson@hpe.com>

On Wed, Oct 14, 2020 at 2:44 AM Bob Pearson <rpearsonhpe@gmail.com> wrote:
>
> If skb_clone is unable to allocate memory for a new
> sk_buff this is not detected by the current code.
>
> Check for a NULL return and continue. This is similar to
> other errors in this loop over QPs attached to the multicast address
> and consistent with the unreliable UD transport.
>
> Fixes: e7ec96fc7932f ("RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()")

Addresses-Coverity-ID: 1497804: Null pointer dereferences (NULL_RETURNS)

Thanks
Zhu Yanjun

> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_recv.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c
> index 11f3daf20768..c9984a28eecc 100644
> --- a/drivers/infiniband/sw/rxe/rxe_recv.c
> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c
> @@ -271,6 +271,9 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)
>                 else
>                         per_qp_skb = skb;
>
> +               if (unlikely(!per_qp_skb))
> +                       continue;
> +
>                 per_qp_pkt = SKB_TO_PKT(per_qp_skb);
>                 per_qp_pkt->qp = qp;
>                 rxe_add_ref(qp);
> --
> 2.25.1
>

  reply	other threads:[~2020-10-14  9:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 18:42 [PATCH for-next] RDMA/rxe - Respond to skb_clone failure in rxe_recv.c Bob Pearson
2020-10-14  0:39 ` Zhu Yanjun [this message]
2020-10-16 17:01 ` Jason Gunthorpe

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='CAD=hENfGR=nLqZNON0=whxDFooG5E+Eq-ggDjrvN+6M+3F7G7w@mail.gmail.com' \
    --to=zyjzyj2000@gmail.com \
    --cc=colin.king@canonical.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearson@hpe.com \
    --cc=rpearsonhpe@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.