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 X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FFE9C11F66 for ; Tue, 29 Jun 2021 10:40:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35C0F61DB3 for ; Tue, 29 Jun 2021 10:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233159AbhF2KnG (ORCPT ); Tue, 29 Jun 2021 06:43:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbhF2KnG (ORCPT ); Tue, 29 Jun 2021 06:43:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A6F261DA7; Tue, 29 Jun 2021 10:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624963239; bh=sVkpmzQWCEEL9ONBlbVeGLRgcYrRDZb2ULQ+nFyRzcA=; h=From:To:Cc:Subject:Date:From; b=GfsuvHKEafoMf6jUf4q3uDvPoc/enit+62jqOsUE0IfvCIrE9wRRuDovrG+a0WLJO VnPoEgnNYNKWdNEzTL3BQfTKby+bsIn1MyE283r/zMA+DolOk3wG7H5bHARHrbpeXI 2q08FJKGJQKmElGgg9upmFOd7j9aPe5hzffczyW0= From: Greg Kroah-Hartman To: Nick Hu , Greentime Hu , Vincent Chen Cc: Greg Kroah-Hartman , iLifetruth , Michal Hocko , Hugh Dickins , Qiang Liu , stable Subject: [PATCH] nds32: fix up stack guard gap Date: Tue, 29 Jun 2021 12:40:24 +0200 Message-Id: <20210629104024.2293615-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1208; h=from:subject; bh=sVkpmzQWCEEL9ONBlbVeGLRgcYrRDZb2ULQ+nFyRzcA=; b=owGbwMvMwCRo6H6F97bub03G02pJDAm3fkx6Pquq2nlT2sJVrpLa22wcv6qffFK/Vk/nJyNT+syn lwzmd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE5CczLFh8Pi30j1tcWY7/rt0nz+ yVZ5+1q5xhrrDVB6Pbxl+2Lvh/LzxluWrQrZocTgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 1be7107fbe18 ("mm: larger stack guard gap, between vmas") fixed up almost all architectures to deal with the stack guard gap, but forgit nds32. Resolve this by properly fixing up the nsd32's version of arch_get_unmapped_area() Reported-by: iLifetruth Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Michal Hocko Cc: Hugh Dickins Cc: Qiang Liu Cc: stable Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas") Signed-off-by: Greg Kroah-Hartman --- arch/nds32/mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/nds32/mm/mmap.c b/arch/nds32/mm/mmap.c index c206b31ce07a..1bdf5e7d1b43 100644 --- a/arch/nds32/mm/mmap.c +++ b/arch/nds32/mm/mmap.c @@ -59,7 +59,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, 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; } -- 2.32.0