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] [day] [month] [year] [list]
Date:	Wed, 29 Sep 2010 14:00:19 +0200
From:	Jerome Marchand <jmarchan@...hat.com>
To:	Pavel Emelyanov <xemul@...allels.com>
CC:	Matthew Wilcox <matthew@....cx>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] procfs: fix numbering in /proc/locks

On 09/29/2010 01:56 PM, Pavel Emelyanov wrote:
> On 09/29/2010 03:52 PM, Jerome Marchand wrote:
>> On 09/29/2010 01:43 PM, Pavel Emelyanov wrote:
>>>> Good point. My implementation is definitely wrong. But I'm afraid that
>>>> moving the increment in locks_next() won't help either. It will fail when
>>>> a program do something more than just read the file sequentially (use
>>>> of lseek() for instance). We need a better way to keep track of the
>>>> current position in the list.
>>>
>>> The seq files core implementation knows about the lseek and
>>> calls the seq_ops callbacks properly.
>>>
>>
>> Yes, but if read a few lines and then lseek() back. I'm afraid it will call
>> a few more locks_next() function and thus increase the counter again.
> 
> No. If you lseek back it calls the locks_start which should reset the
> counter, and then will call locks_next.
> 
> Can you try out my proposal and check whether it really works as expected?
> 

OK. I didn't understand you meant to keep the reset in locks_start(). I'll
try that.

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