diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 19:14:05 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 19:14:05 -0800 |
| commit | 6f267f9cc2ea3c375b3e70e336f4feb7da365fe3 (patch) | |
| tree | e60c68517c38a58abc8af02e76d332e8dae332a8 /fs | |
| parent | 7b4d3039dfd2cbfa15127c29dcb557f314d13db1 (diff) | |
v2.4.6.9 -> v2.4.7
- me: fix ptrace and /proc issues with new core-dump permissions
- numerous: IDE tape driver update for completion handlers
- Ben Collins: ieee1394 GUID cleanups
- Jacek Stepniewski: nasty deadlock in rename()
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/namei.c | 4 | ||||
| -rw-r--r-- | fs/proc/base.c | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index fe7f8fa59aaa..e2a0efa0e1bf 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1688,6 +1688,10 @@ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, error = -EINVAL; if (is_subdir(new_dentry, old_dentry)) goto out_unlock; + /* Don't eat your daddy, dear... */ + /* This also avoids locking issues */ + if (old_dentry->d_parent == new_dentry) + goto out_unlock; target = new_dentry->d_inode; if (target) { /* Hastur! Hastur! Hastur! */ triple_down(&old_dir->i_zombie, diff --git a/fs/proc/base.c b/fs/proc/base.c index 969b91d8981e..edae3acee910 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -645,6 +645,20 @@ static int proc_base_readdir(struct file * filp, /* building an inode */ +static int task_dumpable(struct task_struct *task) +{ + int dumpable = 0; + struct mm_struct *mm; + + task_lock(task); + mm = task->mm; + if (mm) + dumpable = mm->dumpable; + task_unlock(task); + return dumpable; +} + + static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task, int ino) { struct inode * inode; @@ -670,7 +684,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st inode->u.proc_i.task = task; inode->i_uid = 0; inode->i_gid = 0; - if (ino == PROC_PID_INO || task->mm->dumpable) { + if (ino == PROC_PID_INO || task_dumpable(task)) { inode->i_uid = task->euid; inode->i_gid = task->egid; } |
