Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 03:51:42 +0000 (20:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 03:51:42 +0000 (20:51 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  deal with races in /proc/*/{syscall,stack,personality}
  proc: enable writing to /proc/pid/mem
  proc: make check_mem_permission() return an mm_struct on success
  proc: hold cred_guard_mutex in check_mem_permission()
  proc: disable mem_write after exec
  mm: implement access_remote_vm
  mm: factor out main logic of access_process_vm
  mm: use mm_struct to resolve gate vma's in __get_user_pages
  mm: arch: rename in_gate_area_no_task to in_gate_area_no_mm
  mm: arch: make in_gate_area take an mm_struct instead of a task_struct
  mm: arch: make get_gate_vma take an mm_struct instead of a task_struct
  x86: mark associated mm when running a task in 32 bit compatibility mode
  x86: add context tag to mark mm when running a task in 32-bit compatibility mode
  auxv: require the target to be tracable (or yourself)
  close race in /proc/*/environ
  report errors in /proc/*/*map* sanely
  pagemap: close races with suid execve
  make sessionid permissions in /proc/*/task/* match those in /proc/*
  fix leaks in path_lookupat()

Fix up trivial conflicts in fs/proc/base.c

1  2 
arch/x86/mm/init_64.c
fs/binfmt_elf.c
fs/namei.c
fs/proc/base.c
fs/proc/task_mmu.c
include/linux/mm.h
kernel/kallsyms.c
mm/memory.c

Simple merge
diff --cc fs/binfmt_elf.c
Simple merge
diff --cc fs/namei.c
Simple merge
diff --cc fs/proc/base.c
@@@ -337,11 -384,16 +384,16 @@@ static int proc_pid_stack(struct seq_fi
        trace.max_entries       = MAX_STACK_TRACE_DEPTH;
        trace.entries           = entries;
        trace.skip              = 0;
-       save_stack_trace_tsk(task, &trace);
  
-       for (i = 0; i < trace.nr_entries; i++) {
-               seq_printf(m, "[<%pK>] %pS\n",
-                          (void *)entries[i], (void *)entries[i]);
+       err = lock_trace(task);
+       if (!err) {
+               save_stack_trace_tsk(task, &trace);
+               for (i = 0; i < trace.nr_entries; i++) {
 -                      seq_printf(m, "[<%p>] %pS\n",
++                      seq_printf(m, "[<%pK>] %pS\n",
+                                  (void *)entries[i], (void *)entries[i]);
+               }
+               unlock_trace(task);
        }
        kfree(entries);
  
Simple merge
Simple merge
Simple merge
diff --cc mm/memory.c
@@@ -1591,14 -1589,16 +1591,17 @@@ int __get_user_pages(struct task_struc
                                                return i ? i : -EFAULT;
                                        BUG();
                                }
-                               if (ret & VM_FAULT_MAJOR)
-                                       tsk->maj_flt++;
-                               else
-                                       tsk->min_flt++;
+                               if (tsk) {
+                                       if (ret & VM_FAULT_MAJOR)
+                                               tsk->maj_flt++;
+                                       else
+                                               tsk->min_flt++;
+                               }
  
                                if (ret & VM_FAULT_RETRY) {
 -                                      *nonblocking = 0;
 +                                      if (nonblocking)
 +                                              *nonblocking = 0;
                                        return i;
                                }