Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3681323pxv; Mon, 26 Jul 2021 09:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwTeADjwgwHin3pCFqJcnOixx+UDXeeqRAAqFLpISgYw3bq76Gq8HqZJmCFOQeECf3hvVr X-Received: by 2002:a05:6e02:170c:: with SMTP id u12mr14061148ill.116.1627316189454; Mon, 26 Jul 2021 09:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627316189; cv=none; d=google.com; s=arc-20160816; b=u4Wrh35xVRBcx2ThlhKKIHcnmU6huZ09ayCDeKnnTmXNjN1VcaqnHfvf/Px1rkwtz7 9mo0FNOHf+y+vezmN+2EEDCR+Te7rspvvuuXA1ONi5r+9sXOj4nU0z4voBoV3RJwcsdb 6BW+mnGClc85jB4H0x8GGhWV9GucZA+qhY8LrbZcE8RrZb8KaIyf3/JU3vMtXmwHIxNT X8ghs42VFVZBmJDBwgWZLV34RdgflMrtvfgoZrydjRVZ32ymPCS6gD/GDwUut555U6e+ k7x0Kxak5soIK5yaT/oNpNhQYqIPbKBd6bVhshIRx4x0j10CG8uz3DKy2riy2LI5cD8J JNMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CInUzPdpOqMdaQ46xt/EFJSvx7ddKDmS7IPvI5sd68M=; b=ws8aSog4qbfvt2+MpsBkAQP2l2Xl4eWmi0AK07HCA/BPTiSONSRiYFB4TDp1ATECCr ODU+anLYgSW44U6ADbXRS27BzNspzL92ksN4oC/Q76zhViPYuWIhOqDmrpXBb2GooKNS JSD2VVqCKAF2r4/hJOZ0OlkfdK6RSDjI7LJyI6PvQ6F3xUTBdDHjwI8020emRKpr2Csr kh+38WEfXMncYuFn7If0ZSCnqv7mOW6k23CXsenCaT8Y2nvH7Vl4KhPMC6eSvshhtPcF cj9KKZtSTW9QF8BG5sSOXojW4vVavv1BtCk0W1Gu8Uzj2m02O6jyqXOCmMvt+C8lCkGN ymFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OjpQSD0+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si328436jao.88.2021.07.26.09.16.16; Mon, 26 Jul 2021 09:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OjpQSD0+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235332AbhGZPeJ (ORCPT + 99 others); Mon, 26 Jul 2021 11:34:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:60494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236660AbhGZPTX (ORCPT ); Mon, 26 Jul 2021 11:19:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4782A60F70; Mon, 26 Jul 2021 15:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315191; bh=AGq2x0t0KxaJNErco3NfpF3Q+7Djdn+ezKGvOUM6QRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OjpQSD0+UhSVQ1v50xrtdBvr25eL87s8IvKT4cwCPl+aSRCJfB2w2VPaCMaOW3krB OH7aaOLVFe5RHCTXQA2L4vKi4g89A30Sa78JL6DURJ8Y8QIvXgFRRKsU6CR0Q9iFV/ mdtrb3ZuGFWQqc85/VRxgqMCtjTFUyARnpzv2qbs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Hu , Greentime Hu , Vincent Chen , Michal Hocko , Hugh Dickins , Qiang Liu , iLifetruth Subject: [PATCH 5.4 099/108] nds32: fix up stack guard gap Date: Mon, 26 Jul 2021 17:39:40 +0200 Message-Id: <20210726153834.856134642@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman commit c453db6cd96418c79702eaf38259002755ab23ff upstream. Commit 1be7107fbe18 ("mm: larger stack guard gap, between vmas") fixed up all architectures to deal with the stack guard gap. But when nds32 was added to the tree, it forgot to do the same thing. Resolve this by properly fixing up the nsd32's version of arch_get_unmapped_area() Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Michal Hocko Cc: Hugh Dickins Cc: Qiang Liu Cc: stable Reported-by: iLifetruth Acked-by: Hugh Dickins Link: https://lore.kernel.org/r/20210629104024.2293615-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- arch/nds32/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/nds32/mm/mmap.c +++ b/arch/nds32/mm/mmap.c @@ -59,7 +59,7 @@ arch_get_unmapped_area(struct file *filp vma = find_vma(mm, addr); if (TASK_SIZE - len >= addr && - (!vma || addr + len <= vma->vm_start)) + (!vma || addr + len <= vm_start_gap(vma))) return addr; }