All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Nick Hu <nickhu@andestech.com>, Greentime Hu <green.hu@gmail.com>,
	Vincent Chen <deanbo422@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	iLifetruth <yixiaonn@gmail.com>, Michal Hocko <mhocko@suse.com>,
	Hugh Dickins <hughd@google.com>, Qiang Liu <cyruscyliu@gmail.com>,
	stable <stable@vger.kernel.org>
Subject: [PATCH] nds32: fix up stack guard gap
Date: Tue, 29 Jun 2021 12:40:24 +0200	[thread overview]
Message-ID: <20210629104024.2293615-1-gregkh@linuxfoundation.org> (raw)

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 <yixiaonn@gmail.com>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Qiang Liu <cyruscyliu@gmail.com>
Cc: stable <stable@vger.kernel.org>
Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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


             reply	other threads:[~2021-06-29 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 10:40 Greg Kroah-Hartman [this message]
2021-06-29 20:33 ` [PATCH] nds32: fix up stack guard gap Hugh Dickins
2021-06-30  2:33   ` Qiang Liu
2021-06-30  9:05     ` Greg Kroah-Hartman
2021-06-30  9:04   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210629104024.2293615-1-gregkh@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=cyruscyliu@gmail.com \
    --cc=deanbo422@gmail.com \
    --cc=green.hu@gmail.com \
    --cc=hughd@google.com \
    --cc=mhocko@suse.com \
    --cc=nickhu@andestech.com \
    --cc=stable@vger.kernel.org \
    --cc=yixiaonn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.