From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA3DC32772 for ; Fri, 19 Aug 2022 08:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347838AbiHSIzw (ORCPT ); Fri, 19 Aug 2022 04:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348013AbiHSIzf (ORCPT ); Fri, 19 Aug 2022 04:55:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7739EEC48; Fri, 19 Aug 2022 01:55:33 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 8DFF761034; Fri, 19 Aug 2022 08:55:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A84DEC433D6; Fri, 19 Aug 2022 08:55:32 +0000 (UTC) Date: Fri, 19 Aug 2022 10:55:30 +0200 From: Greg KH To: Stephen Rothwell Cc: Arnd Bergmann , Andrew Morton , Liam Howlett , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: manual merge of the char-misc.current tree with the mm-hotfixes tree Message-ID: References: <20220819082714.5313827d@canb.auug.org.au> <20220819184027.7b3fda3e@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220819184027.7b3fda3e@canb.auug.org.au> Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Fri, Aug 19, 2022 at 06:40:27PM +1000, Stephen Rothwell wrote: > Hi Greg, > > On Fri, 19 Aug 2022 08:36:21 +0200 Greg KH wrote: > > > > On Fri, Aug 19, 2022 at 08:28:18AM +1000, Stephen Rothwell wrote: > > > > > > Today's linux-next merge of the char-misc.current tree got a conflict in: > > > > > > drivers/android/binder_alloc.c > > > > > > between commit: > > > > > > b3bb668f3dc6 ("binder_alloc: add missing mmap_lock calls when using the VMA") > > > > > > from the mm-hotfixes tree and commit: > > > > > > d6f35446d076 ("binder_alloc: Add missing mmap_lock calls when using the VMA") > > > > > > from the char-misc.current tree. > > > > > > I fixed it up (I used the latter as it was committed later even though > > > the author times were the same) and can carry the fix as necessary. This > > > is now fixed as far as linux-next is concerned, but any non trivial > > > conflicts should be mentioned to your upstream maintainer when your tree > > > is submitted for merging. You may also want to consider cooperating > > > with the maintainer of the conflicting tree to minimise any particularly > > > complex conflicts. > > > > These should be identical, if not, something went wrong :( > > Something went wrong :-) > > $ git range-diff b3bb668f3dc6^..b3bb668f3dc6 d6f35446d076^..d6f35446d076 > 1: b3bb668f3dc6 ! 1: d6f35446d076 binder_alloc: add missing mmap_lock calls when using the VMA > @@ Metadata > Author: Liam Howlett > > ## Commit message ## > - binder_alloc: add missing mmap_lock calls when using the VMA > + binder_alloc: Add missing mmap_lock calls when using the VMA > > - Take the mmap_read_lock() when using the VMA in binder_alloc_print_pages() > - and when checking for a VMA in binder_alloc_new_buf_locked(). > + Take the mmap_read_lock() when using the VMA in > + binder_alloc_print_pages() and when checking for a VMA in > + binder_alloc_new_buf_locked(). > > It is worth noting binder_alloc_new_buf_locked() drops the VMA read lock > - after it verifies a VMA exists, but may be taken again deeper in the call > - stack, if necessary. > + after it verifies a VMA exists, but may be taken again deeper in the > + call stack, if necessary. > > - Link: https://lkml.kernel.org/r/20220810160209.1630707-1-Liam.Howlett@oracle.com > - Fixes: a43cfc87caaf ("android: binder: stop saving a pointer to the VMA") > - Signed-off-by: Liam R. Howlett > + Fixes: a43cfc87caaf (android: binder: stop saving a pointer to the VMA) > + Cc: stable > Reported-by: Ondrej Mosnacek > - Reported-by: > - Acked-by: Carlos Llamas > + Reported-by: syzbot+a7b60a176ec13cafb793@syzkaller.appspotmail.com > Tested-by: Ondrej Mosnacek > - Cc: Minchan Kim > - Cc: Christian Brauner (Microsoft) > - Cc: Greg Kroah-Hartman > - Cc: Hridya Valsaraju > - Cc: Joel Fernandes > - Cc: Martijn Coenen > - Cc: Suren Baghdasaryan > - Cc: Todd Kjos > - Cc: Matthew Wilcox (Oracle) > - Cc: "Arve Hjønnevåg" > - Signed-off-by: Andrew Morton > + Acked-by: Carlos Llamas > + Signed-off-by: Liam R. Howlett > + Link: https://lore.kernel.org/r/20220810160209.1630707-1-Liam.Howlett@oracle.com > + Signed-off-by: Greg Kroah-Hartman > > ## drivers/android/binder_alloc.c ## > @@ drivers/android/binder_alloc.c: static struct binder_buffer *binder_alloc_new_buf_locked( > @@ drivers/android/binder_alloc.c: void binder_alloc_print_pages(struct seq_file *m > - } > + > + mmap_read_lock(alloc->vma_vm_mm); > -+ if (binder_alloc_get_vma(alloc) == NULL) > ++ if (binder_alloc_get_vma(alloc) == NULL) { > ++ mmap_read_unlock(alloc->vma_vm_mm); > + goto uninitialized; > + } > + > ++ mmap_read_unlock(alloc->vma_vm_mm); > + for (i = 0; i < alloc->buffer_size / PAGE_SIZE; i++) { > + page = &alloc->pages[i]; > + if (!page->page_ptr) > @@ drivers/android/binder_alloc.c: void binder_alloc_print_pages(struct seq_file *m > + active++; > + else > + lru++; > - } > ++ } > + > +uninitialized: > -+ mmap_read_unlock(alloc->vma_vm_mm); > mutex_unlock(&alloc->mutex); > seq_printf(m, " pages: %d:%d:%d\n", active, lru, free); > seq_printf(m, " pages high watermark: %zu\n", alloc->pages_high); > Oh wow, ok, I'll go drop my version and assume that Andrew's is the more correct one and let it come through his tree. thanks, greg k-h