Re: [PATCH] cris: fix integer overflow in ELF_ET_DYN_BASE

From: Jesper Nilsson
Date: Wed Mar 25 2015 - 06:37:13 EST


On Tue, Mar 24, 2015 at 06:31:23PM +0300, Andrey Ryabinin wrote:
> Almost all arches define ELF_ET_DYN_BASE as 2/3 of TASK_SIZE.
> Though it seems that some architectures do this in a wrong way.
> The problem is that 2*TASK_SIZE may overflow 32-bits so
> the real ELF_ET_DYN_BASE becomes wrong.
> Fix this overflow by dividing TASK_SIZE prior to multiplying:
> (TASK_SIZE / 3 * 2)

Good catch, thanks, added to the CRIS-tree.

> Signed-off-by: Andrey Ryabinin <a.ryabinin@xxxxxxxxxxx>

/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@xxxxxxxx
--
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/