lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXwmXef41U32Z6nO@unreal>
Date:   Fri, 29 Oct 2021 19:50:37 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Jason Gunthorpe <jgg@...dia.com>
Cc:     Doug Ledford <dledford@...hat.com>,
        Aharon Landau <aharonl@...dia.com>,
        linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/core: Rely on vendors to set right IOVA

On Fri, Oct 29, 2021 at 01:27:02PM -0300, Jason Gunthorpe wrote:
> On Thu, Oct 28, 2021 at 08:55:22AM +0300, Leon Romanovsky wrote:
> > From: Aharon Landau <aharonl@...dia.com>
> > 
> > The vendors set the IOVA of newly created MRs in rereg_user_mr, so don't
> > overwrite it. That ensures that this field is set only if IB_MR_REREG_TRANS
> > flag is provided.
> > 
> > Fixes: 6e0954b11c05 ("RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr")
> 
> This isn't really a fixes type patch..

Why? We see that without this patch MR IOVA is not as expected.

> 
> > Signed-off-by: Aharon Landau <aharonl@...dia.com>
> > Signed-off-by: Leon Romanovsky <leonro@...dia.com>
> >  drivers/infiniband/core/uverbs_cmd.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> > index 740e6b2efe0e..d1345d76d9b1 100644
> > +++ b/drivers/infiniband/core/uverbs_cmd.c
> > @@ -837,11 +837,8 @@ static int ib_uverbs_rereg_mr(struct uverbs_attr_bundle *attrs)
> >  		new_mr->device = new_pd->device;
> >  		new_mr->pd = new_pd;
> >  		new_mr->type = IB_MR_TYPE_USER;
> > -		new_mr->dm = NULL;
> > -		new_mr->sig_attrs = NULL;
> >  		new_mr->uobject = uobj;
> >  		atomic_inc(&new_pd->usecnt);
> > -		new_mr->iova = cmd.hca_va;
> >  		new_uobj->object = new_mr;
> 
> It is like this because the reg_mr path does it this way, if you want
> to change it here then change reg_mr as well, but that needs auditing
> all the drivers..
> 
> And I'd also suggest removing the other set a few lines below

I decided to be safe than sorry and removed only 100% correct
attributes that does require minimal audit.

Thanks

> 
> Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ