Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752963AbdFUFlP (ORCPT ); Wed, 21 Jun 2017 01:41:15 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35816 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbdFUFlN (ORCPT ); Wed, 21 Jun 2017 01:41:13 -0400 Date: Tue, 20 Jun 2017 22:41:01 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Greg Kroah-Hartman cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Hugh Dickins , Michal Hocko , Linus Torvalds , Willy Tarreau Subject: Re: [PATCH 4.4 30/30] mm: larger stack guard gap, between vmas In-Reply-To: <20170619152034.878842311@linuxfoundation.org> Message-ID: References: <20170619152033.211450261@linuxfoundation.org> <20170619152034.878842311@linuxfoundation.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1592 Lines: 43 On Mon, 19 Jun 2017, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Hugh Dickins > > commit 1be7107fbe18eed3e319a6c3e83c78254b693acb upstream. The 4.11 and 4.9 patches are fine, but I noticed a couple of corrections to this 4.4 one. There are very unlikely circumstances (on VM_GROWSUP architectures only) in which that "highest_vm_end = end" line would be wrong: several different ways to fix it, I'm tending to go with Andrea's observation that the only need for update has already been done above, so just VM_WARN_ON if it's unexpected. Hugh diff -purN 404n/include/linux/mm.h 404h/include/linux/mm.h --- 404n/include/linux/mm.h 2017-06-20 16:48:17.162770068 -0700 +++ 404h/include/linux/mm.h 2017-06-20 17:36:35.871975695 -0700 @@ -1283,6 +1283,8 @@ static inline bool vma_is_anonymous(stru return !vma->vm_ops; } +int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t); + extern unsigned long move_page_tables(struct vm_area_struct *vma, unsigned long old_addr, struct vm_area_struct *new_vma, unsigned long new_addr, unsigned long len, diff -purN 404n/mm/mmap.c 404h/mm/mmap.c --- 404n/mm/mmap.c 2017-06-20 16:48:17.166770032 -0700 +++ 404h/mm/mmap.c 2017-06-20 17:42:31.312682716 -0700 @@ -923,7 +923,7 @@ again: remove_next = 1 + (end > next-> else if (next) vma_gap_update(next); else - mm->highest_vm_end = end; + VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma)); } if (insert && file) uprobe_mmap(insert);