pcp
[Top] [All Lists]

Re: PCP patch for top/libgtop conversion

To: "Albert D. Cahalan" <acahalan@xxxxxxxxxx>
Subject: Re: PCP patch for top/libgtop conversion
From: Keith Owens <kaos@xxxxxxx>
Date: Wed, 27 Nov 2002 12:10:37 +1100
Cc: pcp@xxxxxxxxxxx, todd.c.davis@xxxxxxxxx, mmlnx@xxxxxxxxxx
In-reply-to: Your message of "Tue, 26 Nov 2002 20:00:35 CDT." <200211270100.gAR10ZU443901@xxxxxxxxxxxxxxxxx>
Sender: pcp-bounce@xxxxxxxxxxx
On Tue, 26 Nov 2002 20:00:35 -0500 (EST), 
"Albert D. Cahalan" <acahalan@xxxxxxxxxx> wrote:
>Keith Owens wrote:
>> Most /proc code that generates more than a page of data uses seq_file.
>> That implementation saves a position index which is passed to the
>> seq_operations->start() routine on the next read.  Every such routine
>> in 2.4.19 uses the index as a counter into a list, i.e. all the
>> seq_file code is vulnerable to this race.
>
>It would be dumb for /proc/*/maps to do this. Each line has
>an address that may be used to find back the position.
>
>For /proc/*/cmdline and /proc/*/environ as well, there is
>an address that should be used.
>
>The stat, statm, and status files are tiny.

You are concentrating on just the files used by procps, but PCP has to
worry about other /proc files.  Small files whose data fits in a single
page are not a problem, larger /proc files have races.


<Prev in Thread] Current Thread [Next in Thread>