From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] IB/rxe: Convert pr_info to pr_warn
Date: Wed, 19 Jul 2017 14:04:42 +0300 [thread overview]
Message-ID: <20170719110441.GA26265@yuvallap> (raw)
In-Reply-To: <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
On Wed, Jul 19, 2017 at 10:51:19AM +0300, Leon Romanovsky wrote:
> On Wed, Jul 19, 2017 at 10:11:50AM +0300, Moni Shoua wrote:
> > > How this code can be executed? IB/core ensures that port_num is in range.
> > > You can remove this check.
> > >
> > In this case ah_attr can come from the application and a validity
> > check is necessary.
>
> It is a bug if it comes directly without rdma_is_port_valid() check in the
> IB/core. Currently modify_qp and create_ah are checking it and ensuring that
> user won't provide illegal port number.
Not sure i see the whole picture but something does not fit, will
appreciate a guidance here.
1. Application calls ibv_modify_qp which in turn fills out a cmd object and
"calls" ib_uverbs.ib_uverbs_modify_qp.
2. ib_uverbs_modify_qp copy the cmd from userspace and calls modify_qp.
3. modify_qp, among some other stuff, verifies port validity (which prove
your point) and calls driver's modify_qp hook (in our case rxe_modify_qp).
Is the above correct?
What i do not understand is the check that is done in step #2 since
port_num is not set when moving from state INIT to state RTR.
RXE on the other hands validate port_num only when needed (mask &
IB_QP_AV).
Looks like the check in step #2 is wrong.
What am i missing here?
Yuval
>
> Thanks
--
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
next prev parent reply other threads:[~2017-07-19 11:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 20:35 [PATCH] IB/rxe: Convert pr_info to pr_warn Yuval Shaia
[not found] ` <20170718203539.6777-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-07-19 6:09 ` Leon Romanovsky
[not found] ` <20170719060908.GN3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 7:11 ` Moni Shoua
[not found] ` <CAG9sBKNXfndf8Lxa97Z8Cc=Ntg+=NoZ9-35CbY0X=0f2aXRx8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-19 7:51 ` Leon Romanovsky
[not found] ` <20170719075119.GO3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 11:04 ` Yuval Shaia [this message]
2017-07-19 17:26 ` Leon Romanovsky
[not found] ` <20170719172613.GS3259-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-19 19:54 ` Yuval Shaia
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=20170719110441.GA26265@yuvallap \
--to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=sean.hefty-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 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.