All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tal Alon <talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [RFC ABI V2 5/8] RDMA/core: Add new ioctl interface
Date: Wed, 20 Jul 2016 23:44:39 -0600	[thread overview]
Message-ID: <20160721054439.GA19329@obsidianresearch.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1607202340280.26638-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>

On Thu, Jul 21, 2016 at 12:00:34AM -0500, Christoph Lameter wrote:
> On Wed, 20 Jul 2016, Jason Gunthorpe wrote:
> 
> > > device_id is useless if the driver is already determined by the device filehanle.
> >
> > It isn't useless, it preserves the self describing property that is
> > the kernel standard for ioctls.
> 
> What? Never heard about that and certainly do not see that in the ioctls I
> have used. Something like the device is specified on on some special
> sockets that control network stack behavior and other control files.

How many ioctls have you used that use a complex variable sized struct
as the parameter?

There are a few and they ones I've used are self-describing one way or
another. Perhaps they have an op code or something in the struct, or a
netlink-like format, or *something* but you don't need to know what
the fd is connected to in order to parse the struct. The ioctl # and
the argument should be enough to parse.

> > But the kernel has that implicit knowledge for ioctls as well and we
> >
> > arg.driver_id = MLX4;
> > arg.driver_op = MLX4_FROBNICATE;
> > ioctl(IB_DRIVER_DO_SOMETHING,arg);
> 
> Uhhh.. The first argument to ioctl specifies the device!!! The
> established way of doing things would be:

Yeah, I dropped it for brevity, because it doesn't really matter, we
all know ioctls work on fds...

> Well there is no need to do that with the standard way. The filehandle
> identifies the driver. No need to modify strace and no need to
> schlepp the device_id around.

Nope, that isn't how strace works, strace never checks the filehandle.

> > We do have routing, RDMA_CM does it. Only once the connection is
> > established does it crystalize into specific hardware, which is
> > basically the same process as the net stack, rdma_cm uses the same
> > routing table functions to determine the RDMA device to route the QP
> > too, which is part of the problem with having things spread across all
> > these distinct FDs. They don't coorporate like they need to.
> 
> OMG. And now we are adding vendor specific extensions. This is going to be
> great fun to use. Case statements for vendor specific extension after we
> have figured out which device to use?

There won't be case statements.

You are really surprised by the rdma_cm architecture??? I know it is
goofy, but we are stuck with it..

.. and we have been doing the un-described structs like you are asking
for today. libmlx4 just assumes the fd it is talking to is a mlx4
driver (because sysfs said so) and jams in untagged driver-specific
structs to the command flow. strace cannot parse them and there is no
kernel support for debugging or accidental misuse..

Adding a little tag to the driver specific struct seems totally
harmless, every iteration of the various proposals has had some kind
of struct tag one way or another. I don't know what you see strange
about this.

> Namespaces already work for filehandles and always have. Look how devices
> are handled in different namespaces.

People want to put different ports in different name spaces, the
uverbs fd is a full device thing, it doesn't work and doesn't make
sense as the namespace control point.

Heck, people want to put certain pkeys into namespaces.

The char dev alone is totally unsuitable for the namespace needs.

> Also the filehandle trivially allows security subsystems to monitor the
> usage of a device. One can identify all processes using one RDMA device
> that may be going down etc etc.

Not really, you can have rdma_cm things open listening that don't use
uverbs until a connection is triggered. Perhaps that is rare though.

> We already have the security infrastructure to control access by
> filehandle both single device and multiple device. The multiplexer device
> will cause additional security concerns because the ioctl packet must be
> inspected to find the device. Please do not do this.

I mean in IB, we don't have the ability to securely strip a single
port out of a device. This is why /dev/uverbs0 referes to both ports
on a card. Adding that ability would damage API capabilities we have.

We already have two command multiplexor fds in the current design and
they have exactly the security concerns you allude to. This is why we
have a SELinux patch set under consideration because labeling dev
nodes is not nearly enough. This is why the  namespace patches are
incomplete, etc..

There is no proposal to eliminate the multiplexors, I don't even know
how that could work...

Jason
--
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

  parent reply	other threads:[~2016-07-21  5:44 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 15:23 [RFC ABI V2 0/8] SG-based RDMA ABI Proposal Matan Barak
     [not found] ` <1468941812-32286-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-19 15:23   ` [RFC ABI V2 1/8] RDMA/core: Export RDMA IOCTL declarations Matan Barak
     [not found]     ` <1468941812-32286-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:06       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192004510.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  3:15           ` Leon Romanovsky
2016-07-21  8:07       ` Christoph Hellwig
     [not found]         ` <20160721080719.GB21060-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-07-21 10:49           ` Leon Romanovsky
2016-07-19 15:23   ` [RFC ABI V2 2/8] RDMA/core: Refactor IDR to be per-device Matan Barak
     [not found]     ` <1468941812-32286-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:15       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192014010.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  3:20           ` Leon Romanovsky
     [not found]             ` <20160720032037.GR20674-2ukJVAZIZ/Y@public.gmane.org>
2016-07-20 17:08               ` Jason Gunthorpe
2016-07-20 17:41       ` Jason Gunthorpe
     [not found]         ` <20160720174122.GJ21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:52           ` Matan Barak
     [not found]             ` <13309138-dd3f-7411-d750-4ff370d55daa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21 16:51               ` Jason Gunthorpe
2016-07-19 15:23   ` [RFC ABI V2 3/8] RDMA/core: Add support for custom types Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 4/8] RDMA/core: Introduce add/remove uobj from types Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 5/8] RDMA/core: Add new ioctl interface Matan Barak
     [not found]     ` <1468941812-32286-6-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:25       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192021500.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  8:11           ` Matan Barak
     [not found]             ` <53dd8337-0779-341e-49f5-ad675269bfe6-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 10:03               ` Christoph Lameter
     [not found]                 ` <alpine.DEB.2.20.1607200448370.12616-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20 11:56                   ` Matan Barak
     [not found]                     ` <0fc727fd-bc35-b2bd-f4a7-04efd937d4c3-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21  0:38                       ` Christoph Lameter
2016-07-20 17:21                   ` Jason Gunthorpe
     [not found]                     ` <20160720172143.GG21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  0:57                       ` Christoph Lameter
     [not found]                         ` <alpine.DEB.2.20.1607201950160.24804-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  1:56                           ` Jason Gunthorpe
     [not found]                             ` <20160721015613.GB8279-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  2:41                               ` Christoph Lameter
     [not found]                                 ` <alpine.DEB.2.20.1607202132080.26260-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  3:28                                   ` Jason Gunthorpe
     [not found]                                     ` <20160721032803.GA12093-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  5:00                                       ` Christoph Lameter
     [not found]                                         ` <alpine.DEB.2.20.1607202340280.26638-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  5:44                                           ` Jason Gunthorpe [this message]
     [not found]                                             ` <20160721054439.GA19329-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  7:11                                               ` Christoph Lameter
     [not found]                                                 ` <alpine.DEB.2.20.1607210202400.29415-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21 16:41                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20160721164133.GD19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-25 16:30                                                       ` Christoph Lameter
     [not found]                                                         ` <alpine.DEB.2.20.1607251104370.23039-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-25 18:01                                                           ` Jason Gunthorpe
     [not found]                                                             ` <20160725180119.GB18773-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 15:03                                                               ` Christoph Lameter
     [not found]                                                                 ` <alpine.DEB.2.20.1607270954150.25436-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-27 17:28                                                                   ` Parav Pandit
     [not found]                                                                     ` <CAG53R5XZ9RVg-2yGFbr-7To1SMbRoGG3xiZHf-vNnGM4K+R4pw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-27 18:03                                                                       ` Christoph Lameter
     [not found]                                                                         ` <alpine.DEB.2.20.1607271300150.27032-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-27 18:56                                                                           ` Parav Pandit
     [not found]                                                                             ` <CAG53R5V07Q-O8cmm3Ad23qsH3oDQiw9nL87yG2=ki=Rgg9LQAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-27 18:58                                                                               ` Christoph Lameter
2016-07-21  8:04                                               ` Christoph Hellwig
     [not found]                                                 ` <20160721080433.GA21060-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-07-21 16:20                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20160721162033.GB19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-25 16:32                                                       ` Christoph Lameter
     [not found]                                                         ` <alpine.DEB.2.20.1607251131000.23039-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-25 17:39                                                           ` Jason Gunthorpe
2016-07-19 15:23   ` [RFC ABI V2 6/8] RDMA/core: Add initialize and cleanup of common types Matan Barak
     [not found]     ` <1468941812-32286-7-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 17:40       ` Jason Gunthorpe
     [not found]         ` <20160720174052.GI21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:40           ` Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 7/8] RDMA/core: Add common code for querying device and init context Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 8/8] RDMA/mlx5: Add mlx5 initial support of the new infrastructure Matan Barak
     [not found]     ` <1468941812-32286-9-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 17:39       ` Jason Gunthorpe
     [not found]         ` <20160720173927.GH21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:38           ` Matan Barak
     [not found]             ` <8ffd0f92-2564-cc39-10ab-5db287399e82-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21 16:49               ` Jason Gunthorpe
     [not found]                 ` <20160721164952.GE19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-24  6:18                   ` Matan Barak

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=20160721054439.GA19329@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.