Re: [PATCH 02/19] Make vma_dump_size() generic

From: Ryan Mallon
Date: Mon Oct 07 2013 - 20:24:09 EST


On 04/10/13 20:30, Janani Venkataraman wrote:
> From:Suzuki K. Poulose <suzuki@xxxxxxxxxx>
>
> vma_dump_size calculates the file size of a vma area in the core file. It
> assumes the vma belongs to the "current". Make it generic to work for any task.
> This will be reused by application core dump infrastructure.
>
> Signed-off-by: Suzuki K. Poulose <suzuki@xxxxxxxxxx>
> ---

> -static unsigned long vma_dump_size(struct vm_area_struct *vma,
> +unsigned long vma_dump_size(struct task_struct *p, struct vm_area_struct *vma,
> unsigned long mm_flags)
> {
> #define FILTER(type) (mm_flags & (1UL << MMF_DUMP_##type))
> @@ -143,10 +143,18 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
> * Switch to the user "segment" for get_user(),
> * then put back what elf_core_dump() had in place.
> */
> - set_fs(USER_DS);
> - if (unlikely(get_user(word, header)))
> - word = 0;
> - set_fs(fs);
> + if (p->mm == current->mm) {
> + mm_segment_t fs = get_fs();

It looks like you missed the removal of the old:

mm_segment_t fs = get_fs();

above? Just below if (FILTER(ELF_HEADERS)).

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