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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Jul 2017 08:03:55 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        akpm@...ux-foundation.org, mike.kravetz@...cle.com
Subject: Re: [RFC] mm/mremap: Remove redundant checks inside vma_expandable()

On Tue 11-07-17 09:58:42, Anshuman Khandual wrote:
> On 07/10/2017 07:19 PM, Michal Hocko wrote:
> > On Mon 10-07-17 16:40:59, Anshuman Khandual wrote:
> >> As 'delta' is an unsigned long, 'end' (vma->vm_end + delta) cannot
> >> be less than 'vma->vm_end'.
> > 
> > This just doesn't make any sense. This is exactly what the overflow
> > check is for. Maybe vm_end + delta can never overflow because of
> > (old_len == vma->vm_end - addr) and guarantee old_len < new_len
> > in mremap but I haven't checked that too deeply.
> 
> Irrespective of that, just looking at the variables inside this
> particular function where delta is an 'unsigned long', 'end' cannot
> be less than vma->vm_end. Is not that true ?

no. What happens when end is too large?

[...]

> > here. This is hardly something that would save many cycles in a
> > relatively cold path.
> 
> Though I have not done any detailed instruction level measurement,
> there is a reduction in real and system amount of time to execute
> the test with and without the patch.
> 
> Without the patch
> 
> real	0m2.100s
> user	0m0.162s
> sys	0m1.937s
> 
> With this patch
> 
> real	0m0.928s
> user	0m0.161s
> sys	0m0.756s

Are you telling me that two if conditions cause more than a second
difference? That sounds suspicious.

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ