X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=fs%2Fproc%2Fbase.c;fp=fs%2Fproc%2Fbase.c;h=fb2a5abd4e4facfb83cd9ec0831f6ca11cace34c;hb=4a3956c790290efeb647bbb0c3a90476bb57800e;hp=dc5d5f51f3fe4dc564a19e06cb330d09abc9b6a4;hpb=ba10f486658c0ca1bc84c936f6a996e40d071453;p=net-next-2.6.git diff --git a/fs/proc/base.c b/fs/proc/base.c index dc5d5f51f3f..fb2a5abd4e4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -771,6 +771,8 @@ static const struct file_operations proc_single_file_operations = { static int mem_open(struct inode* inode, struct file* file) { file->private_data = (void*)((long)current->self_exec_id); + /* OK to pass negative loff_t, we can catch out-of-range */ + file->f_mode |= FMODE_UNSIGNED_OFFSET; return 0; }