Messages in this thread | | | Date | Tue, 25 May 2010 12:23:45 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH -mm 1/1] ptrace: PTRACE_GETFDPIC: fix the unsafe usage of child->mm |
| |
On 05/25, David Howells wrote: > > Roland McGrath <roland@redhat.com> wrote: > > > The mm pointer is only used by these uncommon ptrace operations > > Like PEEKTEXT and POKETEXT?
They use access_process_vm().
According to grep, mm is only use to read a couple of members.
Perhaps can even add the simple helper
struct mm_xxx { unsigned long start_code, end_code, start_data, end_data; ... some more ... };
int get_mm_xxx(struct task_struct *tracee, struct mm_xxx *mm_xxx) { struct mm_struct *mm = get_task_mm(tracee); ... }
Except:
- arch/um/kernel/ptrace.c PTRACE_SWITCH_MM does something really strange
- arch/blackfin/kernel/ptrace.c:is_user_addr_valid() needs mmap_sem around find_vma()
The lockless access to mm->context.sram_list doesn't look safe to me.
If we add get_task_mm() - this protects us against destroy_context() only. What is the tracee's sub-thread does sys_sram_alloc() or sys_sram_free() in parallel?
Oleg.
| |