public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nds32: fix up stack guard gap
@ 2021-06-29 10:40 Greg Kroah-Hartman
  2021-06-29 20:33 ` Hugh Dickins
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-06-29 10:40 UTC (permalink / raw)
  To: Nick Hu, Greentime Hu, Vincent Chen
  Cc: Greg Kroah-Hartman, iLifetruth, Michal Hocko, Hugh Dickins,
	Qiang Liu, stable

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nds32: fix up stack guard gap
  2021-06-29 10:40 [PATCH] nds32: fix up stack guard gap Greg Kroah-Hartman
@ 2021-06-29 20:33 ` Hugh Dickins
  2021-06-30  2:33   ` Qiang Liu
  2021-06-30  9:04   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Hugh Dickins @ 2021-06-29 20:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Nick Hu, Greentime Hu, Vincent Chen, iLifetruth, Michal Hocko,
	Hugh Dickins, Qiang Liu, stable

On Tue, 29 Jun 2021, Greg Kroah-Hartman wrote:

> 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>

Acked-by: Hugh Dickins <hughd@google.com>

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.

> ---
>  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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nds32: fix up stack guard gap
  2021-06-29 20:33 ` 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
  1 sibling, 1 reply; 5+ messages in thread
From: Qiang Liu @ 2021-06-30  2:33 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Greg Kroah-Hartman, Nick Hu, Greentime Hu, Vincent Chen,
	iLifetruth, Michal Hocko, stable

Hi,

On Wed, Jun 30, 2021 at 4:33 AM Hugh Dickins <hughd@google.com> wrote:
>
> On Tue, 29 Jun 2021, Greg Kroah-Hartman wrote:
>
> > 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>
>
> Acked-by: Hugh Dickins <hughd@google.com>
>
> but it's a bit unfair to say that commit forgot nds32:
> nds32 came into the tree nearly a year later.
Could we use "not forward ported to"?

>
> > ---
> >  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
> >
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nds32: fix up stack guard gap
  2021-06-29 20:33 ` Hugh Dickins
  2021-06-30  2:33   ` Qiang Liu
@ 2021-06-30  9:04   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-06-30  9:04 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Nick Hu, Greentime Hu, Vincent Chen, iLifetruth, Michal Hocko,
	Qiang Liu, stable

On Tue, Jun 29, 2021 at 01:33:14PM -0700, Hugh Dickins wrote:
> On Tue, 29 Jun 2021, Greg Kroah-Hartman wrote:
> 
> > 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>
> 
> Acked-by: Hugh Dickins <hughd@google.com>
> 
> but it's a bit unfair to say that commit forgot nds32:
> nds32 came into the tree nearly a year later.

Ah, missed that.  I will change the text to say that.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nds32: fix up stack guard gap
  2021-06-30  2:33   ` Qiang Liu
@ 2021-06-30  9:05     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-06-30  9:05 UTC (permalink / raw)
  To: Qiang Liu
  Cc: Hugh Dickins, Nick Hu, Greentime Hu, Vincent Chen, iLifetruth,
	Michal Hocko, stable

On Wed, Jun 30, 2021 at 10:33:29AM +0800, Qiang Liu wrote:
> Hi,
> 
> On Wed, Jun 30, 2021 at 4:33 AM Hugh Dickins <hughd@google.com> wrote:
> >
> > On Tue, 29 Jun 2021, Greg Kroah-Hartman wrote:
> >
> > > 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>
> >
> > Acked-by: Hugh Dickins <hughd@google.com>
> >
> > but it's a bit unfair to say that commit forgot nds32:
> > nds32 came into the tree nearly a year later.
> Could we use "not forward ported to"?

Nah, it was just a mistake in the nds32 implementation when it was
submitted.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-30  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-29 10:40 [PATCH] nds32: fix up stack guard gap Greg Kroah-Hartman
2021-06-29 20:33 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox