From: Linus Torvalds Date: Thu, 24 Mar 2011 03:51:42 +0000 (-0700) Subject: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 X-Git-Tag: firefly_0821_release~7613^2~1827 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b81a618dcd3ea99de292dbe624f41ca68f464376;p=firefly-linux-kernel-4.4.55.git Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6 * '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 --- b81a618dcd3ea99de292dbe624f41ca68f464376 diff --cc fs/proc/base.c index daba13653256,7d5bb8b9a4ff..5a670c11aeac --- a/fs/proc/base.c +++ b/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); diff --cc mm/memory.c index 20d5f7499ce2,468f5076754c..51a5c23704af --- a/mm/memory.c +++ b/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; }