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: <AM3PR05MB0935800AB70D6A7BE8B22921DC3F0@AM3PR05MB0935.eurprd05.prod.outlook.com>
Date:	Sun, 1 Feb 2015 14:10:45 +0000
From:	Shachar Raindel <raindel@...lanox.com>
To:	Yann Droneaud <ydroneaud@...eya.com>
CC:	"roland@...nel.org" <roland@...nel.org>,
	"sean.hefty@...el.com" <sean.hefty@...el.com>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Liran Liss <liranl@...lanox.com>,
	Guy Shapiro <guysh@...lanox.com>,
	Haggai Eran <haggaie@...lanox.com>,
	Yotam Kenneth <yotamke@...lanox.com>
Subject: RE: [PATCH for-next 02/10] IB/core: Pass network namespace as a
 parameter to relevant functions

Hi,

> -----Original Message-----
> From: Yann Droneaud [mailto:ydroneaud@...eya.com]
> Sent: Sunday, February 01, 2015 2:27 PM
> To: Shachar Raindel
> Cc: roland@...nel.org; sean.hefty@...el.com; linux-rdma@...r.kernel.org;
> netdev@...r.kernel.org; Liran Liss; Guy Shapiro; Haggai Eran; Yotam
> Kenneth
> Subject: Re: [PATCH for-next 02/10] IB/core: Pass network namespace as a
> parameter to relevant functions
> 
> Hi,
> 
> Le dimanche 01 février 2015 à 13:28 +0200, Shachar Raindel a écrit :
> > From: Guy Shapiro <guysh@...lanox.com>
> >
> > Add network namespace parameters for the address related ib_core
> > functions. The parameter is passed to lower level function, instead of
> > &init_net, so things are done in the correct namespace.
> >
> > For now pass &init_net on every caller.
> > Callers that will pass &init_net permanently are marked with an
> > appropriate comment.
> >
> > Signed-off-by: Haggai Eran <haggaie@...lanox.com>
> > Signed-off-by: Yotam Kenneth <yotamke@...lanox.com>
> > Signed-off-by: Shachar Raindel <raindel@...lanox.com>
> > Signed-off-by: Guy Shapiro <guysh@...lanox.com>
> >
> > ---
> >  drivers/infiniband/core/agent.c       |  4 +++-
> >  drivers/infiniband/core/cm.c          |  9 +++++++--
> >  drivers/infiniband/core/mad_rmpp.c    | 10 ++++++++--
> >  drivers/infiniband/core/user_mad.c    |  4 +++-
> >  drivers/infiniband/core/verbs.c       | 10 ++++++----
> >  drivers/infiniband/ulp/srpt/ib_srpt.c |  3 ++-
> >  include/rdma/ib_verbs.h               | 15 +++++++++++++--
> >  7 files changed, 42 insertions(+), 13 deletions(-)
> 
> > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> > index 0d74f1de99aa..dd4c80cea8d3 100644
> > --- a/include/rdma/ib_verbs.h
> > +++ b/include/rdma/ib_verbs.h
> > @@ -48,6 +48,7 @@
> >  #include <linux/rwsem.h>
> >  #include <linux/scatterlist.h>
> >  #include <linux/workqueue.h>
> > +#include <net/net_namespace.h>
> >  #include <uapi/linux/if_ether.h>
> >
> >  #include <linux/atomic.h>
> > @@ -1801,9 +1802,14 @@ struct ib_ah *ib_create_ah(struct ib_pd *pd,
> struct ib_ah_attr *ah_attr);
> >   *   ignored unless the work completion indicates that the GRH is
> valid.
> >   * @ah_attr: Returned attributes that can be used when creating an
> address
> >   *   handle for replying to the message.
> > + * @net: The network namespace to use for address resolution.
> > + *
> > + * It is the caller's responsibility to make sure the network
> namespace is
> > + * alive until the function returns.
> 
> Why ?
> 

For the same reason we described in the previous patch. It is nearly impossible to code if your function parameters are not guaranteed to be alive during the call to your function.

> >   */
> >  int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct
> ib_wc *wc,
> > -		       struct ib_grh *grh, struct ib_ah_attr *ah_attr);
> > +		       struct ib_grh *grh, struct ib_ah_attr *ah_attr,
> > +		       struct net *net);
> >
> >  /**
> >   * ib_create_ah_from_wc - Creates an address handle associated with
> the
> > @@ -1813,12 +1819,17 @@ int ib_init_ah_from_wc(struct ib_device
> *device, u8 port_num, struct ib_wc *wc,
> >   * @grh: References the received global route header.  This parameter
> is
> >   *   ignored unless the work completion indicates that the GRH is
> valid.
> >   * @port_num: The outbound port number to associate with the address.
> > + * @net: The network namespace to use for address resolution.
> >   *
> >   * The address handle is used to reference a local or global
> destination
> >   * in all UD QP post sends.
> > + *
> > + * It is the caller's responsibility to make sure the network
> namespace is
> > + * alive until the function returns.
> 
> Why ?
> 

For the same reason we described in the previous patch. It is nearly impossible to code if your function parameters are not guaranteed to be alive during the call to your function.



Thanks,
--Shachar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ