From: Carlos Llamas <cmllamas@google.com>
To: stable@kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Martijn Coenen" <maco@android.com>,
"Joel Fernandes" <joel@joelfernandes.org>,
"Christian Brauner" <christian@brauner.io>,
"Hridya Valsaraju" <hridya@google.com>,
"Suren Baghdasaryan" <surenb@google.com>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
Arnd Bergmann <arnd@arndb.de>, Todd Kjos <tkjos@google.com>,
Randy Dunlap <rdunlap@infradead.org>,
Christian Brauner <christian.brauner@ubuntu.com>,
Carlos Llamas <cmllamas@google.com>
Subject: [PATCH 5.10 4/6] binder: fix pointer cast warning
Date: Wed, 30 Nov 2022 03:58:03 +0000 [thread overview]
Message-ID: <20221130035805.1823970-5-cmllamas@google.com> (raw)
In-Reply-To: <20221130035805.1823970-1-cmllamas@google.com>
From: Arnd Bergmann <arnd@arndb.de>
commit 9a0a930fe2535a76ad70d3f43caeccf0d86a3009 upstream.
binder_uintptr_t is not the same as uintptr_t, so converting it into a
pointer requires a second cast:
drivers/android/binder.c: In function 'binder_translate_fd_array':
drivers/android/binder.c:2511:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
2511 | sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset;
| ^
Fixes: 656e01f3ab54 ("binder: read pre-translated fds from sender buffer")
Acked-by: Todd Kjos <tkjos@google.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211207122448.1185769-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
---
drivers/android/binder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 83c4501153b4..398ce65b578b 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2908,7 +2908,8 @@ static int binder_translate_fd_array(struct list_head *pf_head,
*/
fda_offset = (parent->buffer - (uintptr_t)t->buffer->user_data) +
fda->parent_offset;
- sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset;
+ sender_ufda_base = (void __user *)(uintptr_t)sender_uparent->buffer +
+ fda->parent_offset;
if (!IS_ALIGNED((unsigned long)fda_offset, sizeof(u32)) ||
!IS_ALIGNED((unsigned long)sender_ufda_base, sizeof(u32))) {
--
2.38.1.584.g0f3c55d4c2-goog
next prev parent reply other threads:[~2022-11-30 3:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 3:57 [PATCH 5.10 0/6] binder: backports for data leak and UAF Carlos Llamas
2022-11-30 3:58 ` [PATCH 5.10 1/6] binder: avoid potential data leakage when copying txn Carlos Llamas
2022-11-30 3:58 ` [PATCH 5.10 2/6] binder: read pre-translated fds from sender buffer Carlos Llamas
2022-11-30 3:58 ` [PATCH 5.10 3/6] binder: defer copies of pre-patched txn data Carlos Llamas
2022-11-30 3:58 ` Carlos Llamas [this message]
2022-11-30 3:58 ` [PATCH 5.10 5/6] binder: Address corner cases in deferred copy and fixup Carlos Llamas
2022-11-30 3:58 ` [PATCH 5.10 6/6] binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 Carlos Llamas
2022-11-30 12:42 ` [PATCH 5.10 0/6] binder: backports for data leak and UAF Greg Kroah-Hartman
2022-11-30 16:12 ` Carlos Llamas
2022-11-30 16:33 ` Greg Kroah-Hartman
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=20221130035805.1823970-5-cmllamas@google.com \
--to=cmllamas@google.com \
--cc=arnd@arndb.de \
--cc=arve@android.com \
--cc=christian.brauner@ubuntu.com \
--cc=christian@brauner.io \
--cc=gregkh@linuxfoundation.org \
--cc=hridya@google.com \
--cc=joel@joelfernandes.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maco@android.com \
--cc=rdunlap@infradead.org \
--cc=stable@kernel.org \
--cc=surenb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox