Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp908368rdb; Sat, 7 Oct 2023 04:19:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlYbZ7icpxe6h6hqLNbp2liOIxhOzWTtsC2+XY6LHMwu2I2PoghS4JM7JvTV4/16ZVSms/ X-Received: by 2002:a17:90a:94c8:b0:274:bdcc:85b1 with SMTP id j8-20020a17090a94c800b00274bdcc85b1mr10364107pjw.12.1696677549594; Sat, 07 Oct 2023 04:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696677549; cv=none; d=google.com; s=arc-20160816; b=taCwUGfr/BUaDUkvSx+Yj+I5WgccxBQQ3klRUXMJAowVFZyFgZUQ2GupMjILBepmqy Bvrcb468l/n4hutRDSfr5PdoXee6/icKC5JIk3xve3Lv+GEg29b0Ij2Dm/CsZS9LbQx5 SBnyINw576rTY4xttLAT+P01y5MWs4P6S+UrZeRLH9NzjjAOG4Hukqns+px4MPcf8SM/ Mtaz4q3lAL/uhb6W0xdM9/1zIlv2W0vHPx6kswA+q24g6GMZw0LYQQ1e5BS4gVch3Dec EH0ihk0dOsidexpincanlvkpPRq7HGy5liXLpMUOehgErjGv2+5LTDg4KHaRMag7haNs uIfw== 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=IenoVFXv/Lw+1Fw+XD2pXckIWJkr7GDsBQyTl4DOgE8=; fh=8jYxASQULAXEX0cTonjc/sRL1jTPYygvikVw2lWVZDs=; b=SD+Byl65C6ZbGIs7FbPB7k7SI+mrzCAXtqRYo0usyZfVG1u9tlQ4HJ0OIbDSSFiZOJ iGjU+IDcEvbAXuvcvEOPQmuuHfEnF18dHJvzruKsTBc8jyP9bGvZrdpnaU+jCwbmOmOQ T0t8xN9bG18qK78OGrKNzuCzbj7wi7ybm3x4bigdTbH6/+gcU4zTX9RHrVP729lQYlQO atGMOagWL/3bTpdY9NTrPi4w+QDalXvRr6V2w94v6EeT7VhcBPqpg81v4f9Ov+lgg8ef +58I24lDEmwHJNNP6SPMYEwS+WEO3HqDZWujozCvDPq7KHOjnS5rovBUdOOL7Zv4hBen jFgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fXQevo41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a14-20020a17090a8c0e00b0027681e3a57fsi7738330pjo.162.2023.10.07.04.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 04:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fXQevo41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id F14E9801B3AD; Sat, 7 Oct 2023 04:19:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343859AbjJGLS5 (ORCPT + 99 others); Sat, 7 Oct 2023 07:18:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343812AbjJGLS4 (ORCPT ); Sat, 7 Oct 2023 07:18:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B22CB6 for ; Sat, 7 Oct 2023 04:18:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6178AC433C8; Sat, 7 Oct 2023 11:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696677534; bh=9lhl/Io5D9c5aOL11kV7r2LcfNh3+FYtUhr05ScLEqs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fXQevo416IGR/tBe40pbdCAluOz50c6NVvZfl6Mar7STFV4B8WQ7sEEXOPOy5FH+A jaTol9RhaZjwvnJbmbqMYs6Em4/tybefmplmNi+5lL897GuW4TjlziaLsohvDKyXOJ n359PKwtc+dQBBBuoTvTF7luDzLLMu08ljDoBzyg= Date: Sat, 7 Oct 2023 13:18:52 +0200 From: Greg KH To: Kassey Li Cc: gregkh@google.com, cmllamas@google.com, surenb@google.com, arve@android.com, joel@joelfernandes.org, brauner@kernel.org, tkjos@android.com, maco@android.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] binder: add mutex_lock for mmap and NULL when free Message-ID: <2023100725-oversized-shore-c873@gregkh> References: <20231007034046.2352124-1-quic_yingangl@quicinc.com> <2023100715-blade-valiant-714d@gregkh> <26988068-8c9f-8591-db6e-44c8105af638@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26988068-8c9f-8591-db6e-44c8105af638@quicinc.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 07 Oct 2023 04:19:07 -0700 (PDT) X-Spam-Level: ** On Sat, Oct 07, 2023 at 07:07:40PM +0800, Kassey Li wrote: > > > On 2023/10/7 14:44, Greg KH wrote: > > On Sat, Oct 07, 2023 at 11:40:46AM +0800, Kassey Li wrote: > > > Enforce alloc->mutex in binder_alloc_mmap_handler when add > > > the entry to list. > > > > > > Assign the freed pages/page_ptr to NULL to catch possible > > > use after free with NULL pointer access. > > > > > > Signed-off-by: Kassey Li > > > --- > > > drivers/android/binder_alloc.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > What commit id does this fix? > > there is no specific commit id this change going to fix. > > it is a follow up for commit > 19c987241ca1216a51118b2bd0185b8bc5081783 binder: separate out binder_alloc > functions (mutex lock added for list access in alloc/free) > f2517eb76f1f2f7f89761f9db2b202e89931738c android: binder: Add global lru > shrinker to binder (set page->page_ptr = NULL;) > > the background to raise this change that we are easy hit below crash in > monkey test: > > where a wrong end is passing to > binder_update_page_range, thus calculate a weird index > for > page = &alloc->pages[index] Obviously it is a fix for some commit, please list that here. thanks, greg k-h