From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: linux-rdma@vger.kernel.org
Subject: Re: RDMA subsystem namespace related questions (was Re: Finding the namespace of a struct ib_device)
Date: Thu, 8 Oct 2020 18:49:09 +0800 [thread overview]
Message-ID: <83be474c-ac18-ce96-e161-fed86668ffed@oracle.com> (raw)
In-Reply-To: <20201007122830.GM5177@ziepe.ca>
On 10/7/20 8:28 PM, Jason Gunthorpe wrote:
> On Wed, Oct 07, 2020 at 04:38:45PM +0800, Ka-Cheong Poon wrote:
>> On 10/6/20 8:46 PM, Jason Gunthorpe wrote:
>>> On Tue, Oct 06, 2020 at 05:36:32PM +0800, Ka-Cheong Poon wrote:
>>>
>>>>>>> Kernel modules should not be doing networking unless commanded to by
>>>>>>> userspace.
>>>>>>
>>>>>> It is still not clear why this is an issue with RDMA
>>>>>> connection, but not with general kernel socket. It is
>>>>>> not random networking. There is a purpose.
>>>>>
>>>>> It is a problem with sockets too, how do the socket users trigger
>>>>> their socket usages? AFAIK all cases originate with userspace
>>>>
>>>> A user starts a namespace. The module is loaded for servicing
>>>> requests. The module starts a listener. The user deletes
>>>> the namespace. This scenario will have everything cleaned up
>>>> properly if the listener is a kernel socket. This is not the
>>>> case with RDMA.
>>>
>>> Please point to reputable code in upstream doing this
>>
>>
>> It is not clear what "reputable" here really means. If it just
>> means something in kernel, then nearly all, if not all, Internet
>> protocols code in kernel create a control kernel socket for every
>> network namespaces. That socket is deleted in the per namespace
>> exit function. If it explicitly means listening socket, AFS and
>> TIPC in kernel do that for every namespaces. That socket is
>> deleted in the per namespace exit function.
>
> AFS and TIPC are not exactly well reviewed mainstream areas.
How about all the other Internet protocol code? They all
create a kernel socket without user interaction. If it is
using rdma_create_id(), it will prevent a namespace from
being deleted.
>> It is very common for a network protocol to have something like
>> this for protocol processing. It is not clear why RDMA subsystem
>> behaves differently and forbids this common practice. Could you
>> please elaborate the issues this practice has such that the RDMA
>> subsystem cannot support it?
>
> The kernel should not have rouge listening sockets just because a
> model is loaded. Creation if listening kernel side sockets should be
> triggered by userspace.
It is unclear why the socket is "rogue". A sys admin loads a
kernel module for a reason. It cannot be randomly loaded by
itself. In this respect, it is not different from a user space
daemon. No one will describe a listening socket started by a daemon
when it starts as "rogue". Why is a listening socket started by a
kernel module "rogue"? If a user is remote, without the listening
socket, how can anything work in the first place?
--
K. Poon
ka-cheong.poon@oracle.com
prev parent reply other threads:[~2020-10-08 10:49 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 14:02 Finding the namespace of a struct ib_device Ka-Cheong Poon
2020-09-03 17:39 ` Jason Gunthorpe
2020-09-04 4:01 ` Ka-Cheong Poon
2020-09-04 11:32 ` Jason Gunthorpe
2020-09-04 14:02 ` Ka-Cheong Poon
2020-09-06 7:44 ` Leon Romanovsky
2020-09-07 3:33 ` Ka-Cheong Poon
2020-09-07 7:18 ` Leon Romanovsky
2020-09-07 8:24 ` Ka-Cheong Poon
2020-09-07 9:04 ` Leon Romanovsky
2020-09-07 9:28 ` Ka-Cheong Poon
2020-09-07 10:22 ` Leon Romanovsky
2020-09-07 13:48 ` Ka-Cheong Poon
2020-09-29 16:57 ` RDMA subsystem namespace related questions (was Re: Finding the namespace of a struct ib_device) Ka-Cheong Poon
2020-09-29 17:40 ` Jason Gunthorpe
2020-09-30 10:32 ` Ka-Cheong Poon
2020-10-02 14:04 ` Jason Gunthorpe
2020-10-05 10:27 ` Ka-Cheong Poon
2020-10-05 13:16 ` Jason Gunthorpe
2020-10-05 13:57 ` Ka-Cheong Poon
2020-10-05 14:25 ` Jason Gunthorpe
2020-10-05 15:02 ` Ka-Cheong Poon
2020-10-05 15:45 ` Jason Gunthorpe
2020-10-06 9:36 ` Ka-Cheong Poon
2020-10-06 12:46 ` Jason Gunthorpe
2020-10-07 8:38 ` Ka-Cheong Poon
2020-10-07 11:16 ` Leon Romanovsky
2020-10-08 10:22 ` Ka-Cheong Poon
2020-10-08 10:36 ` Leon Romanovsky
2020-10-08 11:08 ` Ka-Cheong Poon
2020-10-08 16:08 ` Jason Gunthorpe
2020-10-08 16:21 ` Chuck Lever
2020-10-08 16:46 ` Jason Gunthorpe
2020-10-09 4:49 ` Ka-Cheong Poon
2020-10-09 14:39 ` Jason Gunthorpe
2020-10-09 14:48 ` Chuck Lever
2020-10-09 14:57 ` Jason Gunthorpe
2020-10-09 15:00 ` Chuck Lever
2020-10-09 15:07 ` Jason Gunthorpe
2020-10-09 15:27 ` Chuck Lever
2020-10-09 15:34 ` Jason Gunthorpe
2020-10-09 15:52 ` Chuck Lever
2020-10-12 8:20 ` Ka-Cheong Poon
2020-10-16 18:54 ` Jason Gunthorpe
2020-10-16 20:49 ` Chuck Lever
2020-10-19 18:31 ` Jason Gunthorpe
2020-10-07 12:28 ` Jason Gunthorpe
2020-10-08 10:49 ` Ka-Cheong Poon [this message]
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=83be474c-ac18-ce96-e161-fed86668ffed@oracle.com \
--to=ka-cheong.poon@oracle.com \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox