From: Greg KH <gregkh@linuxfoundation.org>
To: Todd Kjos <tkjos@android.com>
Cc: tkjos@google.com, arve@android.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, maco@google.com,
christian.brauner@canonical.com, ben@decadent.org.uk
Subject: Re: [PATCH v2] binder: use standard functions to allocate fds
Date: Tue, 28 Aug 2018 14:07:33 -0700 [thread overview]
Message-ID: <20180828210733.GB31143@kroah.com> (raw)
In-Reply-To: <20180828204625.232573-1-tkjos@google.com>
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@google.com>
> ---
> v2: use "%zu" printk format for size_t
Is this really v3?
next prev parent reply other threads:[~2018-08-28 21:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 20:46 [PATCH v2] binder: use standard functions to allocate fds Todd Kjos
2018-08-28 21:07 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-28 20:43 Todd Kjos
2018-08-28 20:43 ` Todd Kjos
2018-08-28 21:07 ` Greg KH
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=20180828210733.GB31143@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arve@android.com \
--cc=ben@decadent.org.uk \
--cc=christian.brauner@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@google.com \
--cc=tkjos@android.com \
--cc=tkjos@google.com \
/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.