binder: fix premature fd_install() and buffer leak on read -EFAULT
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 1 replyIn review
- v11 patch 1 replySuperseded
Changes in v2 from the cover letter
- Split into a 2-patch series with separate single-purpose commits as requested by Greg Kroah-Hartman and Carlos Llamas.
- Added Reviewed-by tag from Carlos Llamas.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | binder: defer fd_install() until after copy_to_user() in binder_thread_read()drivers/ | +15 | 0 replies | |
| 2/2 | binder: free transaction buffer via binder_free_buf() on read -EFAULTdrivers/ | +8 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Carlos Llamas |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] binder: fix premature fd_install() and buffer leak on read -EFAULT
This series fixes two error-handling issues in binder_thread_read():
1. Defer fd_install() until after put_user() and copy_to_user() succeed, preventing file descriptors from being prematurely installed into the recipient process's file descriptor table when userspace copy fails.
2. Call binder_free_buf() on -EFAULT error paths in binder_thread_read() so the transaction buffer and associated node/ref references are freed.
Changes in v2:
- Split into a 2-patch series with separate single-purpose commits as requested by Greg Kroah-Hartman and Carlos Llamas.
- Added Reviewed-by tag from Carlos Llamas.
Hui Peng (2):
binder: defer fd_install() until after copy_to_user() in binder_thread_read()
binder: free transaction buffer via binder_free_buf() on read -EFAULT
drivers/android/binder.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)