]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/proc/base.c
vfs: introduce FMODE_UNSIGNED_OFFSET for allowing negative f_pos
[net-next-2.6.git] / fs / proc / base.c
index dc5d5f51f3fe4dc564a19e06cb330d09abc9b6a4..fb2a5abd4e4facfb83cd9ec0831f6ca11cace34c 100644 (file)
@@ -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;
 }