[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1512067110.3020.24.camel@HansenPartnership.com>
Date: Thu, 30 Nov 2017 10:38:30 -0800
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Christoph Hellwig <hch@...radead.org>
Cc: platform-driver-x86@...r.kernel.org, x86@...nel.org,
linux-kernel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
"open list:FILESYSTEMS (VFS and infrastructure)"
<linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH v6 09/11] fs/pipe.c: export create_pipe_files() and
replace_fd()
On Thu, 2017-11-30 at 18:43 +0200, Jarkko Sakkinen wrote:
> On Wed, Nov 29, 2017 at 03:13:57PM -0800, Christoph Hellwig wrote:
> >
> > On Tue, Nov 28, 2017 at 11:57:53PM +0200, Jarkko Sakkinen wrote:
> > >
> > > >
> > > > Yes. You still shall not play nasty games with file
> > > > descriptors.
> > >
> > > I need to put something to file descriptors in order to have a IO
> > > channels for the launch enclave hosting process.
> >
> > Just do it like any other program - open it from your userspace
> > program using open() and related syscalls.
>
> In this case it would not work as the launch enclave is still part of
> the kernel and it would create a dependency how the user space
> defines paths. If using pipe specifically is an issue, I could easily
> use shmem file as a mean for communiation.
Can't you simply use
sys_pipe2()
sys_close()
sys_dup2()
To achieve the same effect as replace_fd()/create_pipe_files()?
The point Christoph is making is that you can call sys_ interfaces from
within the kernel (carefully) and have them operate like direct
invocations. Look at main.c:kernel_init_freeable() it's doing
something similar to what you want, except with the console, not a pipe
and it begins with the file table empty.
James
Powered by blists - more mailing lists