Re: [Patch 14/21] Create ELF header

From: Oleg Nesterov
Date: Tue Dec 14 2010 - 11:31:15 EST


On 12/14, Suzuki K. Poulose wrote:
>
> +static void get_elfhdr_size(struct core_proc *cp)
> +{
> + struct vm_area_struct *gate_vma;
> + int segs;
> +
> + segs = cp->task->mm->map_count;

But this is unsafe. What if cp->task was stopped when
open_gencore() was called? In this case it can be killed/dead.

cp->task->mm can be NULL. In fact, cp->task can point to nothing.

Any usage of cp->task is not safe, afaics.

Oleg.

--
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/