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-next>] [day] [month] [year] [list]
Message-ID: <COL130-W6916929C85FB1943CC1B11B9530@phx.gbl>
Date:	Tue, 8 Sep 2015 22:14:19 +0800
From:	Chen Gang <xili_gchen_5257@...mail.com>
To:	"oleg@...hat.com" <oleg@...hat.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
	"riel@...hat.com" <riel@...hat.com>, Michal Hocko <mhocko@...e.cz>,
	"sasha.levin@...cle.com" <sasha.levin@...cle.com>,
	"pfeiner@...gle.com" <pfeiner@...gle.com>,
	"aarcange@...hat.com" <aarcange@...hat.com>,
	"vishnu.ps@...sung.com" <vishnu.ps@...sung.com>,
	Linux Memory <linux-mm@...ck.org>,
	kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in
 find_vma()

On 9/7/15 20:36, Oleg Nesterov wrote:
> On 09/05, Chen Gang wrote:
>>
>> From b12fa5a9263cf4c044988e59f0071f4bcc132215 Mon Sep 17 00:00:00 2001
>> From: Chen Gang <gang.chen.5i5j@...il.com>
>> Date: Sat, 5 Sep 2015 21:49:56 +0800
>> Subject: [PATCH] mm/mmap.c: Remove useless statement "vma = NULL" in
>> find_vma()
>>
>> Before the main looping, vma is already is NULL, so need not set it to
>> NULL, again.
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
>
> Reviewed-by: Oleg Nesterov <oleg@...hat.com>
>

OK, thanks.


I also want to consult: the comments of find_vma() says:

"Look up the first VMA which satisfies addr < vm_end, ..."

Is it OK? (why not "vm_start <= addr < vm_end"), need we let "vma = tmp"
in "if (tmp->vm_start <= addr)"? -- it looks the comments is not match
the implementation, precisely (maybe not 1st VMA).


Thanks.


>> ---
>> mm/mmap.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/mm/mmap.c b/mm/mmap.c
>> index df6d5f0..4db7cf0 100644
>> --- a/mm/mmap.c
>> +++ b/mm/mmap.c
>> @@ -2054,7 +2054,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
>> return vma;
>>
>> rb_node = mm->mm_rb.rb_node;
>> - vma = NULL;
>>
>> while (rb_node) {
>> struct vm_area_struct *tmp;
>> --
>> 1.9.3
>>
>>
>
>

--
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed
 		 	   		  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ