[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180828210733.GB31143@kroah.com>
Date: Tue, 28 Aug 2018 14:07:33 -0700
From: Greg KH <gregkh@...uxfoundation.org>
To: Todd Kjos <tkjos@...roid.com>
Cc: tkjos@...gle.com, arve@...roid.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, maco@...gle.com,
christian.brauner@...onical.com, ben@...adent.org.uk
Subject: Re: [PATCH v2] binder: use standard functions to allocate fds
On Tue, Aug 28, 2018 at 01:46:25PM -0700, Todd Kjos wrote:
> Binder uses internal fs interfaces to allocate and install fds:
>
> __alloc_fd
> __fd_install
> __close_fd
> get_files_struct
> put_files_struct
>
> These were used to support the passing of fds between processes
> as part of a transaction. The actual allocation and installation
> of the fds in the target process was handled by the sending
> process so the standard functions, alloc_fd() and fd_install()
> which assume task==current couldn't be used.
>
> This patch refactors this mechanism so that the fds are
> allocated and installed by the target process allowing the
> standard functions to be used.
>
> The sender now creates a list of fd fixups that contains the
> struct *file and the address to fixup with the new fd once
> it is allocated. This list is processed by the target process
> when the transaction is dequeued.
>
> A new error case is introduced by this change. If an async
> transaction with file descriptors cannot allocate new
> fds in the target (probably due to out of file descriptors),
> the transaction is discarded with a log message. In the old
> implementation this would have been detected in the sender
> context and failed prior to sending.
>
> Signed-off-by: Todd Kjos <tkjos@...gle.com>
> ---
> v2: use "%zu" printk format for size_t
Is this really v3?
Powered by blists - more mailing lists