lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 14 Apr 2023 13:26:10 -0400
From:   "Liam R. Howlett" <Liam.Howlett@...cle.com>
To:     "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
Cc:     "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] mm/mmap: Regression fix for unmapped_area{_topdown}

* Edgecombe, Rick P <rick.p.edgecombe@...el.com> [230414 12:27]:
> On Fri, 2023-04-14 at 10:57 -0400, Liam R. Howlett wrote:<br>
> > +       tmp = mas_next(&mas, ULONG_MAX);
> > +       if (tmp && (tmp->vm_flags & VM_GROWSDOWN)) {
> 
> Why also check VM_GROWSDOWN here (and VM_GROWSUP below)?
> vm_start/end_gap() already have checks inside.

An artifact of a plan that was later abandoned.

> 
> > +               if (vm_start_gap(tmp) < gap + length - 1) {
> > +                       low_limit = tmp->vm_end;
> > +                       mas_reset(&mas);
> > +                       goto retry;
> > +               }
> > +       } else {
> > +               tmp = mas_prev(&mas, 0);
> > +               if (tmp && (tmp->vm_flags & VM_GROWSUP) &&
> > +                   vm_end_gap(tmp) > gap) {
> > +                       low_limit = vm_end_gap(tmp); 
> > +                       mas_reset(&mas);
> > +                       goto retry; 
> > +               }
> > +       } 
> > +
> 
> Could it be like this?

Yes, I'll make this change.  Thanks for the suggestion.

> 
> tmp = mas_next(&mas, ULONG_MAX);
> if (tmp && vm_start_gap(tmp) < gap + length - 1) {
> 		low_limit = tmp->vm_end;
> 		mas_reset(&mas);
> 		goto retry;
> 	}
> } else {
> 	tmp = mas_prev(&mas, 0);
> 	if (tmp && vm_end_gap(tmp) > gap) {
> 		low_limit = vm_end_gap(tmp);
> 		mas_reset(&mas);
> 		goto retry;
> 	}
> }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ