Showing error 1875

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/proc/root.c
Line in file: 76
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 46
 47        if (proc_mnt) {
 48                /* Seed the root directory with a pid so it doesn't need
 49                 * to be special in base.c.  I would do this earlier but
 50                 * the only task alive when /proc is mounted the first time
 51                 * is the init_task and it doesn't have any pids.
 52                 */
 53                ei = PROC_I(proc_mnt->mnt_sb->s_root->d_inode);
 54                if (!ei->pid)
 55                        ei->pid = find_get_pid(1);
 56        }
 57
 58        if (flags & MS_KERNMOUNT)
 59                ns = (struct pid_namespace *)data;
 60        else
 61                ns = current->nsproxy->pid_ns;
 62
 63        sb = sget(fs_type, proc_test_super, proc_set_super, ns);
 64        if (IS_ERR(sb))
 65                return PTR_ERR(sb);
 66
 67        if (!sb->s_root) {
 68                sb->s_flags = flags;
 69                err = proc_fill_super(sb);
 70                if (err) {
 71                        up_write(&sb->s_umount);
 72                        deactivate_super(sb);
 73                        return err;
 74                }
 75
 76                ei = PROC_I(sb->s_root->d_inode);
 77                if (!ei->pid) {
 78                        rcu_read_lock();
 79                        ei->pid = get_pid(find_pid_ns(1, ns));
 80                        rcu_read_unlock();
 81                }
 82
 83                sb->s_flags |= MS_ACTIVE;
 84                ns->proc_mnt = mnt;
 85        }
 86
Show full sources