Re: [PATCH rdma-next v2 7/7] RDMA/nldev: Provide detailed QP information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 10, 2018 at 03:56:22PM -0700, Jason Gunthorpe wrote:
> On Wed, Jan 10, 2018 at 09:17:22AM +0200, Leon Romanovsky wrote:
> > On Tue, Jan 09, 2018 at 01:09:17PM -0700, Jason Gunthorpe wrote:
> > > On Tue, Jan 02, 2018 at 10:18:32AM +0200, Leon Romanovsky wrote:
> > >
> > > > +	/* PID == 0 means that this QP was created by kernel */
> > > > +	if (qp->res.pid && nla_put_u32(msg,
> > > > +				       RDMA_NLDEV_ATTR_RES_PID, qp->res.pid))
> > >
> > > This is returning a pid in the init name space, obtained here:
> > >
> > > +		res->pid = task_pid_nr(current);
> > >
> > > And since the netlink user is not running in the init name space this
> > > will return the wrong pid #, and worse potentially pids the current
> > > name space should not see.
> > >
> > > This API also needs to filter the results and only return pids
> > > visible, and translate the pids as well..
> >
> > Correct, PID namespace wasn't taken into account, exactly as it wasn't
> > taken in CMA. So, right now, CMA netlink statistics is returning wrong
> > and unfiltered PIDs. How do you want to progress with that part of the code?
>
> It should be fixed or deleted.

So, should I proceed with this patch? Remove CMA statistics?
https://patchwork.kernel.org/patch/10056129/

>
> > I personally have no plans to fix CMA netlink code and for my opinion it
> > should be removed, instead of beating that dead horse.
>
> What is so wrong with it you can't use it anyhow?

In addition to posted in the CMA statistics removal RFC thread, it is
now very clearly seen that CMA statistics returns wrong PID in not
initial PID namespace.

Thanks

>
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux