From: Leon Romanovsky <leon@kernel.org>
To: Mark Bloch <markb@mellanox.com>
Cc: Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@mellanox.com>,
linux-rdma@vger.kernel.org, Daniel Jurgens <danielj@mellanox.com>,
Paul Moore <paul@paul-moore.com>, Don Dutile <ddutile@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH rdma-rc 1/2] IB/core: Only enforce security for InfiniBand
Date: Tue, 21 Nov 2017 15:22:15 +0200 [thread overview]
Message-ID: <20171121132215.GU18825@mtr-leonro.local> (raw)
In-Reply-To: <4f5268b5-e5b6-a7d9-2096-70b4ae8facaf@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]
On Tue, Nov 21, 2017 at 12:44:10PM +0200, Mark Bloch wrote:
> Hi,
>
> On 21/11/2017 12:26, Leon Romanovsky wrote:
> > From: Daniel Jurgens <danielj@mellanox.com>
> >
> > For now the only LSM security enforcement mechanism available is
> > specific to InfiniBand. Bypass enforcement for non-IB link types.
> > This fixes a regression where modify_qp fails for iWARP because
> > querying the PKEY returns -EINVAL.
> >
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: Don Dutile <ddutile@redhat.com>
> > Cc: stable@vger.kernel.org
> > Reported-by: Potnuri Bharat Teja <bharat@chelsio.com>
> > Fixes: d291f1a65232("IB/core: Enforce PKey security on QPs")
> > Fixes: 47a2b338fe63("IB/core: Enforce security on management datagrams")
> > Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
> > Reviewed-by: Parav Pandit <parav@mellanox.com>
> > Tested-by: Potnuri Bharat Teja <bharat@chelsio.com>
> > Signed-off-by: Leon Romanovsky <leon@kernel.org>
> > ---
> > drivers/infiniband/core/security.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
> > index 23278ed5be45..314bf1137c7b 100644
> > --- a/drivers/infiniband/core/security.c
> > +++ b/drivers/infiniband/core/security.c
> > @@ -417,8 +417,17 @@ void ib_close_shared_qp_security(struct ib_qp_security *sec)
> >
> > int ib_create_qp_security(struct ib_qp *qp, struct ib_device *dev)
> > {
> > + u8 i = rdma_start_port(dev);
> > + bool is_ib = false;
> > int ret;
> >
> > + while (i <= rdma_end_port(dev) && !is_ib)
> > + is_ib = rdma_protocol_ib(dev, i++);
> > +
>
> What happens if we have mixed port types?
We will have is_ib set and qp_sec will be allocated on device layer and
not on port level, but because pkeys are IB specific term (at least, I
didn't find any mentioning in RoCE spec), the modify_qp won't query
for PKEYS.
> I believe mlx4 can expose two ports where each port uses a different ll protocol.
> Was that changed?
It is still true.
>
> > + /* If this isn't an IB device don't create the security context */
> > + if (!is_ib)
> > + return 0;
> > +
> > qp->qp_sec = kzalloc(sizeof(*qp->qp_sec), GFP_KERNEL);
> > if (!qp->qp_sec)
> > return -ENOMEM;
> >
>
> Mark.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-11-21 13:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-21 10:26 [PATCH rdma-rc 0/2] RDMA fixes for 4.15 Leon Romanovsky
2017-11-21 10:26 ` [PATCH rdma-rc 1/2] IB/core: Only enforce security for InfiniBand Leon Romanovsky
2017-11-21 10:44 ` Mark Bloch
2017-11-21 13:22 ` Leon Romanovsky [this message]
[not found] ` <20171121132215.GU18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-21 13:56 ` Mark Bloch
2017-11-21 15:14 ` Jason Gunthorpe
2017-11-21 15:33 ` Mark Bloch
2017-11-21 15:36 ` Jason Gunthorpe
[not found] ` <3eff140b-8f0f-1c4f-07b7-9dec46090a1e-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-21 15:37 ` Daniel Jurgens
[not found] ` <410e7b54-02f5-849c-e3ad-56cc61f66647-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-21 16:04 ` Jason Gunthorpe
[not found] ` <20171121160442.GB18272-uk2M96/98Pc@public.gmane.org>
2017-11-21 16:34 ` Leon Romanovsky
2017-11-21 16:36 ` Jason Gunthorpe
[not found] ` <20171121163648.GC18272-uk2M96/98Pc@public.gmane.org>
2017-11-21 16:48 ` Leon Romanovsky
[not found] ` <20171121164802.GY18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-21 17:10 ` Jason Gunthorpe
2017-11-21 18:16 ` Don Dutile
2017-11-21 18:57 ` Jason Gunthorpe
2017-11-21 20:40 ` Leon Romanovsky
[not found] ` <20171121163454.GW18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-21 18:15 ` Don Dutile
[not found] ` <4f5268b5-e5b6-a7d9-2096-70b4ae8facaf-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-21 13:56 ` Daniel Jurgens
[not found] ` <20171121102618.31216-2-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-11-22 16:49 ` Leon Romanovsky
[not found] ` <20171121102618.31216-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-11-21 10:26 ` [PATCH rdma-rc 2/2] RDMA/cma: Make sure that PSN is not over max allowed Leon Romanovsky
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=20171121132215.GU18825@mtr-leonro.local \
--to=leon@kernel.org \
--cc=danielj@mellanox.com \
--cc=ddutile@redhat.com \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=markb@mellanox.com \
--cc=paul@paul-moore.com \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).