Re: [PATCH -mm 1/1] ptrace: PTRACE_GETFDPIC: fix the unsafe usage of child->mm

From: Mike Frysinger
Date: Tue May 25 2010 - 13:28:48 EST


On Tue, May 25, 2010 at 06:23, Oleg Nesterov wrote:
> Â Â Â Â- 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?

i dont believe there are any code paths in UP systems where this would
be a practical problem because sram_list is only updated by syscalls
from userspace. we probably should add proper locking to this
structure though. i'll open a tracker item about it, thanks !
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/