public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Andrew Morton <akpm@osdl.org>
Cc: viro@parcelfarce.linux.theplanet.co.uk, arekm@pld-linux.org,
	linux-kernel@vger.kernel.org, jmorris@redhat.com,
	sds@epoch.ncsc.mil, "Albert D. Cahalan" <acahalan@cs.uml.edu>
Subject: Re: 2.6.0-test9 and sleeping function called from invalid context
Date: Sun, 26 Oct 2003 12:03:55 +0100	[thread overview]
Message-ID: <3F9BAA1B.6080203@colorfullife.com> (raw)
In-Reply-To: <20031026014153.0fdbd50a.akpm@osdl.org>

Andrew Morton wrote:

>What protects against concurrent execution of proc_pid_lookup() and
>proc_task_lookup()?  I think nothing, because one is at /proc/42 and the
>other is at /proc/41/42; the parent dir inodes are different.  hmm.
>  
>
Ugs.
/proc/1 and /proc/1/task/1 are two different dentrys.
proc_task_lookup happily overwrites task->proc_dentry. Which means the 
task patch broke tsk->proc_dentry.
I think the cure is simple: proc_task_lookup should not write 
proc_dentry, only proc_pid_lookup should do that.
tsk->proc_dentry is only used by proc_pid_flush: If a task exits, all 
entries below /proc/<pid> are stale, and a shrink_dcache_parent on the 
/proc/<pid> dentry recovers the memory.
There is a race between in proc_pid_lookup between checking that the 
task is still running and setting tsk->proc_dentry, but AFAICS the race 
is not critical: In the worst case, the stale dentries remain around. 
They are never returned to user space, d_revalidate prevents that.

--
    Manfred



  parent reply	other threads:[~2003-10-26 11:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-25 22:45 2.6.0-test9 and sleeping function called from invalid context Arkadiusz Miskiewicz
2003-10-26  1:50 ` Andrew Morton
2003-10-26  5:49   ` Andrew Morton
2003-10-26  8:26     ` viro
2003-10-26  8:41       ` Andrew Morton
2003-10-26  9:41         ` viro
2003-10-26 11:03         ` Manfred Spraul [this message]
2003-10-26 17:26           ` Manfred Spraul
2003-10-27 13:52     ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F9BAA1B.6080203@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=acahalan@cs.uml.edu \
    --cc=akpm@osdl.org \
    --cc=arekm@pld-linux.org \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@epoch.ncsc.mil \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox