Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1802298rwb; Tue, 29 Nov 2022 20:12:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5T57s7Z9FOjTX2p8VHC8gLbTppkh4v8V0Z1a/oyLhXR/kiwOvJTP9Pt8GzgbBQn04RgDGg X-Received: by 2002:a17:906:882:b0:7ad:e161:b026 with SMTP id n2-20020a170906088200b007ade161b026mr45394494eje.760.1669781576840; Tue, 29 Nov 2022 20:12:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669781576; cv=none; d=google.com; s=arc-20160816; b=OELIIcRwH9zJxIk0/YlSY5Bfl4rnZ9mubMY0CU6XfE4yMCBLp1dkmxGMq91w21+WH5 q38pdNR2ERoWAaceM9NOozM/Hfb2pef1MBkCkh/GAeycGrKYMHqR8sKRGvraurrb1Ds1 YfYXELqpXa3Fi1IiK0lhbdBvKeDU9EuZcUY514ZA7krkP3OeBiFPr0iKaxNp3AZUopXa ekjXIe+QeD64ntpQGG1ON7Mn/790S4csQIYIoN5Eg0vhGGMUvmhjYKykmI6/aFb2fIkj dcvHJ2r2mxStkm0cQxSZRYdiLcHtrdKZ/YIX66ZfSNT/5fWISpa2/d1TkqqCySkofzZD b5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=uianWyO94cQpF/P6HGzSV03i6PkpsS/S96Y6uBo/3Ds=; b=kabtanJdECVVLyo5kyJ2BIuD94lFxW6j+G4wQw4X+7OfRzdL0aBIntjAuuoZRGeeYB f10nID5e3S9nWNkm5zY9CD++ywyfUo1MbWc7XLs1wR9nvDdvo4EWT/cVKDGXnoWi3eg/ 308o808lLevUDF9q+JoxsLniC9JCXjt6/OhZg7dxDeLesEjliCL/P9jJHksqv/ZBhhAP CxBN22pST51SuwgIJSqOYtDxlDdYfY6XdUQgxbEYa/iN+gBlllcpRlHe1nYYEhEbCFF9 unzXz9mm4aCKoc2w0njYLZlDHw1mytY75vol+naV99WwsWueEfXl4EF5J4tXFnPUFabv nYZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=E8mhl3Ms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc3-20020a1709078a0300b007ae8b1704d0si459229ejc.68.2022.11.29.20.12.36; Tue, 29 Nov 2022 20:12:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=E8mhl3Ms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232455AbiK3D6x (ORCPT + 85 others); Tue, 29 Nov 2022 22:58:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232697AbiK3D6b (ORCPT ); Tue, 29 Nov 2022 22:58:31 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE7C06B384 for ; Tue, 29 Nov 2022 19:58:28 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-348608c1cd3so144869137b3.10 for ; Tue, 29 Nov 2022 19:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=uianWyO94cQpF/P6HGzSV03i6PkpsS/S96Y6uBo/3Ds=; b=E8mhl3MsUu8J7sEV9cjA5n8kjdZMdvqNIv8yFsHsA6PeKqXy5VCYYgmw89HSnDDLa/ Bem4EzOGEkFQmAo/7/tXsCa1QaQeFap30WRLI2JrzeD7ZAVamY4WY/qrFIVlDWJPP2GX 0r+MTtAS3JhwEWrwAmYq0Qw9ve+og1OpfxlpyeLj/xFv18SGeWkoivPzSFqRoRc8X0y0 3ZyN5XXXrUnedET8Uj016XcYNAHfFEI/HmtjuKQf5s0ABZUqdH1TS4PFqDxnbFAQEXOl tP5GY0K71O+vWgI8dBg0DH4FlZ4lbJetRzKwh3bhb1NdgequVj+4OYokPYhR9O0iOj9l r+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uianWyO94cQpF/P6HGzSV03i6PkpsS/S96Y6uBo/3Ds=; b=7eHdkyjVqY0CZWyWeeoxLBpj6cUrLeTXlfcbF/1VoCvbm/ENja3ia7QeU77E7aN8CG hbVAH0zrNccoAPsEwyalxaVVzoQwzL6zC2looXHnvbI67f3CeJUQ3rvyJ3ZZ38mc6LsM A0sBowtUOcFzcUWQkKjvn9GaTK97W6IvXFdw0ClymVe2hsf2jX+eJgLyrMh0SKDFzsWO RQaYNjsjMhSp0YidWqV8mDEjm/8Gd4eTcAsfZ2YO4lFk2k3zcAu2y0DyFcr9fpT+E3HQ nrCouMBFKRG4/1emIIhU+ZJEO1TNfhJnGc/5LQF20hZxUJ4k6l1IJkrbKcThdKIggUTD iJBQ== X-Gm-Message-State: ANoB5pkn3oMlt5rgner8KI1FlgK/jZf8jT9dEX5JY3yF6p/fIi3UCnJG 4gFhWQQ7/MojeWClhHeMYIYGK01DELk/bQ== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a25:e758:0:b0:6f7:b717:d64d with SMTP id e85-20020a25e758000000b006f7b717d64dmr10263671ybh.236.1669780707969; Tue, 29 Nov 2022 19:58:27 -0800 (PST) Date: Wed, 30 Nov 2022 03:58:03 +0000 In-Reply-To: <20221130035805.1823970-1-cmllamas@google.com> Mime-Version: 1.0 References: <20221130035805.1823970-1-cmllamas@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221130035805.1823970-5-cmllamas@google.com> Subject: [PATCH 5.10 4/6] binder: fix pointer cast warning From: Carlos Llamas To: stable@kernel.org, Greg Kroah-Hartman , "=?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?=" , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Arnd Bergmann , Todd Kjos , Randy Dunlap , Christian Brauner , Carlos Llamas Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann 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 Acked-by: Randy Dunlap # build-tested Acked-by: Christian Brauner Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211207122448.1185769-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Carlos Llamas --- 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