binder: use standard functions to allocate fds
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> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
-
mentioned in commit dbc772be
-
mentioned in commit c79caa0a
-
mentioned in commit c3c739b8
-
mentioned in commit 1dd34503
-
mentioned in commit b38ea172
-
mentioned in commit ea52b4f9
-
mentioned in commit 3d8c36b6
-
mentioned in commit 45ab20cc
-
mentioned in commit e28eaaec
-
mentioned in commit f8fb7751
-
mentioned in commit 66cba626
-
mentioned in commit 99e26f73
-
mentioned in commit bf55ddce
-
mentioned in commit af53c0c4
-
mentioned in commit a67c5f9a
-
mentioned in commit 2ce28090
-
mentioned in commit c1a4ea40
-
mentioned in commit 92394544
-
mentioned in commit 828a6eb3
-
mentioned in commit 64319d4b
-
mentioned in commit 20153712
-
mentioned in commit 9caa51de
-
mentioned in commit 913110b7
Please sign in to comment