From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [PATCH 00/10] IB: Replace safe uses for ib_get_dma_mr with pd->local_dma_lkey Date: Thu, 23 Jul 2015 11:42:11 -0700 Message-ID: <55B13583.5010208@sandisk.com> References: <1437608083-22898-1-git-send-email-jgunthorpe@obsidianresearch.com> <55B0F06E.8000603@sandisk.com> <20150723183044.GA1868@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150723183044.GA1868-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jason Gunthorpe Cc: Doug Ledford , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Amir Vadai , Andy Grover , Chien Yen , Christoph Hellwig , Dominique Martinet , Eli Cohen , Eric Van Hensbergen , Ido Shamay , Latchesar Ionkov , Or Gerlitz , Roi Dayan , Ron Minnich , Sagi Grimberg , Simon Derr , Tom Tucker , Zach Brown , "rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org" , "target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "v9fs-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" List-Id: linux-rdma@vger.kernel.org On 07/23/2015 11:31 AM, Jason Gunthorpe wrote: > It looks to me like register_always is similar to iSER, it is trying > to avoid a MR if there is only 1 S/G entry. That performance behavior > needs to default to disabled. The kernel must default to secure out of > the box. > > [ ... ] > > This probably also takes care of the security issue for SRP, what do you > think? >[ ... ] > diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c > index fb9fed0fac28..a1e3818d0791 100644 > --- a/drivers/infiniband/ulp/srp/ib_srp.c > +++ b/drivers/infiniband/ulp/srp/ib_srp.c > @@ -69,7 +69,7 @@ static unsigned int cmd_sg_entries; > static unsigned int indirect_sg_entries; > static bool allow_ext_sg; > static bool prefer_fr; > -static bool register_always; > +static bool register_always = true; If we want security by default then I propose not only to change the default value of register_always from false into true but also to change the default value of prefer_fr from false into true such that fast registration becomes the default instead of FMR. > + if (register_always) > + mr_flags |= IB_ACCESS_REMOTE_READ | IB_ACCESS_REMOTE_WRITE; Hmm ... did you perhaps intend if (!register_always) instead ? Thanks, Bart. -- 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