Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2303217rwb; Wed, 30 Nov 2022 05:09:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wDxeIt39BaSMus5W/dzImASFGyVlSJh4I1cpyKxgkitPHO3iuPofPVnNJxB1DLnuyk94+ X-Received: by 2002:a05:6a00:f87:b0:574:653d:9177 with SMTP id ct7-20020a056a000f8700b00574653d9177mr35108266pfb.83.1669813775830; Wed, 30 Nov 2022 05:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669813775; cv=none; d=google.com; s=arc-20160816; b=UrDEdeMjtcjnyPY/lyoTazAlZcfOxSsMAvf9Dp5tWrKA8R2dOby805LNTkLLn2/AV6 qezNaHrnur0QeWnzg/rNA1CV5KJ2QT9AubCmQcTGQX1r94yWwYQY2OI+/xlOOFDjKpSn pSefA7z+i6E+GDbfgjNCSYmtpuZJNqUv/fDpDLqVHf/DHbD/zFbVc4Uumwcs00EI+nRZ L6/UB0WWipcHrsgZio6WvDzkv/Jc55hahGthR/f6ssfXVuMRc2in2dTHOimLpze7Lgjs B5693JkTG+MB4LKr4/QP2LQwzZ/I/CfhFicG45TACx7QV3aGjPdfyIcyK77Os/b6wcB4 EgRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d8/cA7HTkmVA9lEFg/PdqYj9mMmxJKCbkir/ZS6IWrU=; b=0KGkbX/GBf0CcB4MC8PjN+swiaLuwO1IW1lgipX2QTlKurURpAdF/CfIww9EcETKja EbJQPINER3WuQ5QcEG/c7L5Mc/6hEaVtxDasOHWcb6YQBdUYjjDgicnPtWqHHOee5QTn wlwwSDEQ4nBiR/Szz57aaWsTgHRTg75ImQgyB0Hu3q9/sEVhfZk28XxoUJrEDTmtJPtX A1OzEzQNyOy/eM8gm/+yBpYTSO24XVBhlGRVtivZ30R3Byt/8NvSXp0vhzhulXXuy2+P PAbs9Reg8SsNBVXFJzyi3enm9t0xGKXcnhCe/w3odUoCN5+V30RxUSYW0k45YLlcFruk tuzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="M6VNy9M/"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id px12-20020a17090b270c00b002190932890asi1505084pjb.57.2022.11.30.05.09.23; Wed, 30 Nov 2022 05:09:35 -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=@linuxfoundation.org header.s=korg header.b="M6VNy9M/"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234219AbiK3Mmi (ORCPT + 84 others); Wed, 30 Nov 2022 07:42:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233918AbiK3Mmg (ORCPT ); Wed, 30 Nov 2022 07:42:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07CFB2BD8 for ; Wed, 30 Nov 2022 04:42:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B3979B81A7C for ; Wed, 30 Nov 2022 12:42:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E29D3C433C1; Wed, 30 Nov 2022 12:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669812152; bh=GRjGS5i/zixu/d/rdcqZ1QlptYxr8aRxr16aqJBrgSo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M6VNy9M/8qVMjEaOzq0nbrSDjKyYFaa1YPhUg7z7kP7supC/LHoQY8t4kv7zL0Qli 3Me6o1t/v0bAkBodB07aoJnWQDlZXTRlSDUcI5C7lcpOGYGkOP1CiNWH6Iho7PQtkm LywRW0iIlHTLsWcnhWO06Tq+k4YATnhjVHOGtQoY= Date: Wed, 30 Nov 2022 13:42:23 +0100 From: Greg Kroah-Hartman To: Carlos Llamas Cc: stable@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Zi Fan Tan , Todd Kjos Subject: Re: [PATCH 5.10 0/6] binder: backports for data leak and UAF Message-ID: References: <20221130035805.1823970-1-cmllamas@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221130035805.1823970-1-cmllamas@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Wed, Nov 30, 2022 at 03:57:59AM +0000, Carlos Llamas wrote: > This series of backports consists of 3 main patches from Todd submitted > upstream in [1]. The intention is to avoid untranslated data from the > senders to be visible to the target processes. More details of this > issue can be found in the same thread. > > Furthermore, Todd's patches also fix a use-after-free issue introduced > by commit 32e9f56a96d8 ("binder: don't detect sender/target during > buffer cleanup"). In which invalid userspace input causes unprocessed > objects to be incorrectly released. Any subsequent references to these > objects will trigger a UAF as noted by the following KASAN trace: > > [ 244.748468] ================================================================== > [ 244.750486] BUG: KASAN: use-after-free in binder_ioctl+0xb88/0x32e0 > [ 244.751276] Read of size 8 at addr ffff67b1865bea58 by task poc/593 > [ 244.752074] > [ 244.752725] CPU: 0 PID: 593 Comm: poc Not tainted 5.10.156 #1 > [ 244.753683] Hardware name: linux,dummy-virt (DT) > [ 244.754717] Call trace: > [ 244.755216] dump_backtrace+0x0/0x2a0 > [ 244.755836] show_stack+0x18/0x2c > [ 244.756306] dump_stack+0xf8/0x164 > [ 244.756807] print_address_description.constprop.0+0x9c/0x538 > [ 244.757590] kasan_report+0x120/0x200 > [ 244.758236] __asan_load8+0xa0/0xc4 > [ 244.758756] binder_ioctl+0xb88/0x32e0 > [ 244.759283] __arm64_sys_ioctl+0xd4/0x120 > [ 244.759677] el0_svc_common.constprop.0+0xac/0x270 > [ 244.760184] do_el0_svc+0x38/0xa0 > [ 244.760540] el0_svc+0x1c/0x2c > [ 244.760898] el0_sync_handler+0xe8/0x114 > [ 244.761419] el0_sync+0x180/0x1c0 > > This second issue along with the reference to the commit fixing it was > first reported by Zi Fan. > > The other 3 commits included in this series are simply upstream fixes > for the main patches. > > I've tested this series applied to 5.10 and 5.4 which fixes the issues > above as expected. So please pick these up for 5.10 and 5.4 stable. > > [1] https://lore.kernel.org/all/20211130185152.437403-1-tkjos@google.com/ > > Thanks, > Carlos Llamas > > Cc: Zi Fan Tan > Cc: Todd Kjos > Cc: Greg Kroah-Hartman All now queued up, thanks. greg k-h