summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-03 21:46:06 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-03 21:46:06 +0000
commit3e414096429d55fbc8116171bba3487647bbe638 (patch)
tree2b5fcfd9d16fa3a32c829fc2076f6e3785b43374 /fs/proc
parent20b23bfcf36fcb2d16d8b844501072541970637c (diff)
Merge with Linux 2.4.0-test3-pre2.
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index fb63722d5..01f5b22ea 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -408,6 +408,7 @@ static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
goto out;
error = inode->u.proc_i.op.proc_get_link(inode, &nd->dentry, &nd->mnt);
+ nd->last_type = LAST_BIND;
out:
#ifdef NULL_VFSMNT
mntput(dummy);
@@ -706,6 +707,7 @@ static struct dentry_operations pid_base_dentry_operations =
};
/* Lookups */
+#define MAX_MULBY10 ((~0U-9)/10)
static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
{
@@ -726,10 +728,10 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry)
name++;
if (c > 9)
goto out;
+ if (fd >= MAX_MULBY10)
+ goto out;
fd *= 10;
fd += c;
- if (fd & 0xffff8000)
- goto out;
}
inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_FD_DIR+fd);
@@ -940,12 +942,12 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry)
name++;
if (c > 9)
goto out;
+ if (pid >= MAX_MULBY10)
+ goto out;
pid *= 10;
pid += c;
if (!pid)
goto out;
- if (pid & 0xffff0000)
- goto out;
}
read_lock(&tasklist_lock);