Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: staging/rdma/hfi1: pre-compute sc and sde for RC/UC QPs
Date: Tue, 24 Nov 2015 15:57:55 +0300	[thread overview]
Message-ID: <20151124125755.GA7088@mwanda> (raw)

Hello Mike Marciniszyn,

The patch d7b8ba5121e8: "staging/rdma/hfi1: pre-compute sc and sde
for RC/UC QPs" from Nov 9, 2015, leads to the following static
checker warning:

	drivers/staging/rdma/hfi1/verbs.c:1657 ah_to_sc()
	error: buffer overflow 'ibp->sl_to_sc' 32 <= 255

drivers/staging/rdma/hfi1/qp.c
   817          if (attr_mask & IB_QP_PATH_MIG_STATE) {
   818                  qp->s_mig_state = attr->path_mig_state;
   819                  if (mig) {
   820                          qp->remote_ah_attr = qp->alt_ah_attr;
   821                          qp->port_num = qp->alt_ah_attr.port_num;
   822                          qp->s_pkey_index = qp->s_alt_pkey_index;
   823                          qp->s_flags |= HFI1_S_AHG_CLEAR;
   824                          qp->s_sc = ah_to_sc(ibqp->device, &qp->remote_ah_attr);

Do we need to verify (hfi1_check_ah(ibqp->device, &qp->remote_ah_attr))
before calling ah_to_sc()?


   825                          qp->s_sde = qp_to_sdma_engine(qp, qp->s_sc);
   826                  }
   827          }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2015-11-24 12:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 12:57 Dan Carpenter [this message]
2015-11-24 14:09 ` staging/rdma/hfi1: pre-compute sc and sde for RC/UC QPs Marciniszyn, Mike
2015-11-24 21:12 ` Marciniszyn, Mike
2015-11-24 21:20 ` Marciniszyn, Mike

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=20151124125755.GA7088@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox