]> err.no Git - linux-2.6/blobdiff - fs/proc/base.c
[NET]: Remove unused security member in sk_buff
[linux-2.6] / fs / proc / base.c
index 4718173af2c8c3469703bf114b6eba2a5ae3ad96..ace151fa487865fd160546d27c07e31384fa17c9 100644 (file)
@@ -314,7 +314,7 @@ static int may_ptrace_attach(struct task_struct *task)
             (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE))
                goto out;
        rmb();
-       if (!task->mm->dumpable && !capable(CAP_SYS_PTRACE))
+       if (task->mm->dumpable != 1 && !capable(CAP_SYS_PTRACE))
                goto out;
        if (security_ptrace(current, task))
                goto out;
@@ -820,7 +820,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
                goto out_free_page;
 
        }
-       length = audit_set_loginuid(task->audit_context, loginuid);
+       length = audit_set_loginuid(task, loginuid);
        if (likely(length == 0))
                length = count;
 
@@ -1113,7 +1113,9 @@ static int task_dumpable(struct task_struct *task)
        if (mm)
                dumpable = mm->dumpable;
        task_unlock(task);
-       return dumpable;
+       if(dumpable == 1)
+               return 1;
+       return 0;
 }
 
 
@@ -1419,6 +1421,8 @@ static struct file_operations proc_tgid_attr_operations;
 static struct inode_operations proc_tgid_attr_inode_operations;
 #endif
 
+static int get_tid_list(int index, unsigned int *tids, struct inode *dir);
+
 /* SMP-safe */
 static struct dentry *proc_pident_lookup(struct inode *dir, 
                                         struct dentry *dentry,
@@ -1458,7 +1462,7 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
         */
        switch(p->type) {
                case PROC_TGID_TASK:
-                       inode->i_nlink = 3;
+                       inode->i_nlink = 2 + get_tid_list(2, NULL, dir);
                        inode->i_op = &proc_task_inode_operations;
                        inode->i_fop = &proc_task_operations;
                        break;
@@ -1701,13 +1705,13 @@ static struct inode_operations proc_self_inode_operations = {
 };
 
 /**
- * proc_pid_unhash -  Unhash /proc/<pid> entry from the dcache.
+ * proc_pid_unhash -  Unhash /proc/@pid entry from the dcache.
  * @p: task that should be flushed.
  *
- * Drops the /proc/<pid> dcache entry from the hash chains.
+ * Drops the /proc/@pid dcache entry from the hash chains.
  *
- * Dropping /proc/<pid> entries and detach_pid must be synchroneous,
- * otherwise e.g. /proc/<pid>/exe might point to the wrong executable,
+ * Dropping /proc/@pid entries and detach_pid must be synchroneous,
+ * otherwise e.g. /proc/@pid/exe might point to the wrong executable,
  * if the pid value is immediately reused. This is enforced by
  * - caller must acquire spin_lock(p->proc_lock)
  * - must be called before detach_pid()
@@ -1739,8 +1743,8 @@ struct dentry *proc_pid_unhash(struct task_struct *p)
 }
 
 /**
- * proc_pid_flush - recover memory used by stale /proc/<pid>/x entries
- * @proc_entry: directoy to prune.
+ * proc_pid_flush - recover memory used by stale /proc/@pid/x entries
+ * @proc_dentry: directoy to prune.
  *
  * Shrink the /proc directory that was used by the just killed thread.
  */
@@ -1943,7 +1947,8 @@ static int get_tid_list(int index, unsigned int *tids, struct inode *dir)
 
                if (--index >= 0)
                        continue;
-               tids[nr_tids] = tid;
+               if (tids != NULL)
+                       tids[nr_tids] = tid;
                nr_tids++;
                if (nr_tids >= PROC_MAXPIDS)
                        break;
@@ -2043,6 +2048,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
        }
 
        nr_tids = get_tid_list(pos, tid_array, inode);
+       inode->i_nlink = pos + nr_tids;
 
        for (i = 0; i < nr_tids; i++) {
                unsigned long j = PROC_NUMBUF;