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]
Message-ID: <49293777.8070404@gmail.com>
Date:	Sun, 23 Nov 2008 12:59:03 +0200
From:	Török Edwin <edwintorok@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
CC:	srostedt@...hat.com, a.p.zijlstra@...llo.nl, sandmann@...mi.au.dk,
	linux-kernel@...r.kernel.org, viro@...IV.linux.org.uk
Subject: Re: [PATCH 2/3] tracing/stack-tracer: fix locking

On 2008-11-23 12:52, Ingo Molnar wrote:
> * Török Edwin <edwintorok@...il.com> wrote:
>
>   
>> +		down_read(&mm->mmap_sem);
>> +		vma = find_vma(mm, ip);
>>  		if (vma) {
>>  			file = vma->vm_file;
>>  			vmstart = vma->vm_start;
>>  		}
>> +		up_read(&mm->mmap_sem);
>>  	}
>>  	if (file) {
>>  		ret = trace_seq_path(s, &file->f_path);
>>     
>
> and now it's "file" that is held without a reference and possibly 
> racy.
>   

I'll move the (file) inside the mmap_sem too, since file is part of vma,
and you need mmap_sem to access the vma
nobody can modify (file) if they don't hold mmap_sem.
Am I right?

--Edwin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ