Re: SMP races in proc with thread_struct

2001-05-05 Thread Todd Inglett
Andreas Ferber wrote: > > On Fri, May 04, 2001 at 10:46:43PM +1000, Keith Owens wrote: > > > For a read only case, the only important > > thing is not to die, one occurrence of bad data is tolerable. > > Strong NACK. The pages where the bad data comes from may in some cases > already be reclaim

Re: SMP races in proc with thread_struct

2001-05-04 Thread Keith Owens
On 04 May 2001 15:11:37 +0200, Andreas Schwab <[EMAIL PROTECTED]> wrote: >Keith Owens <[EMAIL PROTECTED]> writes: >|> Wrap the reference to the parent task structure with exception table >|> recovery code, like copy_from_user(). > >Exception tables only protect accesses to user virtual memory. K

[PATCH][RFC] Re: SMP races in proc with thread_struct

2001-05-04 Thread Alexander Viro
Linus, could you consider the patch below? As it is, access to /proc//status of dead process with dead parent is possible and leads to access to freed memory. Besides, cd /proc/ means that even after is gone, readdir() _and_ lookup on /proc/ work. Patch makes sure that ->p_pptr is NULL on

Re: SMP races in proc with thread_struct

2001-05-04 Thread Alexander Viro
On Fri, 4 May 2001, Todd Inglett wrote: > Ok, I've got this isolated. Here's the sequence of events: > > 1. Some process T (probably "top") opens /proc/N/stat. > 2. While holding tasklist_lock the proc code does a get_task_struct() > to add a ref count to the page. > 3. Process N exits. >

Re: SMP races in proc with thread_struct

2001-05-04 Thread Andreas Ferber
Hi, On Fri, May 04, 2001 at 10:46:43PM +1000, Keith Owens wrote: > For a read only case, the only important > thing is not to die, one occurrence of bad data is tolerable. Strong NACK. The pages where the bad data comes from may in some cases already be reclaimed for other data, probably someth

Re: SMP races in proc with thread_struct

2001-05-04 Thread Brian Gerst
Andreas Schwab wrote: > > Keith Owens <[EMAIL PROTECTED]> writes: > > |> On Fri, 04 May 2001 07:34:20 -0500, > |> Todd Inglett <[EMAIL PROTECTED]> wrote: > |> >But this is where hell breaks loose. Every process has a valid parent > |> >-- unless it is dead and nobody cares. Process N has alrea

Re: SMP races in proc with thread_struct

2001-05-04 Thread Andreas Schwab
Keith Owens <[EMAIL PROTECTED]> writes: |> On Fri, 04 May 2001 07:34:20 -0500, |> Todd Inglett <[EMAIL PROTECTED]> wrote: |> >But this is where hell breaks loose. Every process has a valid parent |> >-- unless it is dead and nobody cares. Process N has already exited and |> >released from the

Re: SMP races in proc with thread_struct

2001-05-04 Thread Keith Owens
On Fri, 04 May 2001 07:34:20 -0500, Todd Inglett <[EMAIL PROTECTED]> wrote: >But this is where hell breaks loose. Every process has a valid parent >-- unless it is dead and nobody cares. Process N has already exited and >released from the tasklist while its parent was still alive. There was >n

Re: SMP races in proc with thread_struct

2001-05-04 Thread Todd Inglett
Ok, I've got this isolated. Here's the sequence of events: 1. Some process T (probably "top") opens /proc/N/stat. 2. While holding tasklist_lock the proc code does a get_task_struct() to add a ref count to the page. 3. Process N exits. 4. The parent of process N exits. 5. Process T reads fr

Re: SMP races in proc with thread_struct

2001-05-03 Thread Todd Inglett
Alexander Viro wrote: > > On Tue, 1 May 2001, Todd Inglett wrote: > > > Perhaps this is old news...but... > > > > I can easily create a race when reading /proc//stat > > (fs/proc/{base.c,array.c}) where a rapidly reading application, such as > > "top", starts reading stats for a thread which goe

Re: SMP races in proc with thread_struct

2001-05-01 Thread Alexander Viro
On Tue, 1 May 2001, Todd Inglett wrote: > Perhaps this is old news...but... > > I can easily create a race when reading /proc//stat > (fs/proc/{base.c,array.c}) where a rapidly reading application, such as > "top", starts reading stats for a thread which goes away during the > read. This is e

SMP races in proc with thread_struct

2001-05-01 Thread Todd Inglett
Perhaps this is old news...but... I can easily create a race when reading /proc//stat (fs/proc/{base.c,array.c}) where a rapidly reading application, such as "top", starts reading stats for a thread which goes away during the read. This is easily reproduced with a program that rapidly forks and