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

2015-03-25 Thread Hans-Christian Egtvedt
Around Tue 24 Mar 2015 18:31:22 +0300 or thereabout, 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

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

2015-03-25 Thread Hans-Christian Egtvedt
Around Tue 24 Mar 2015 18:31:22 +0300 or thereabout, 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

[PATCH] avr32: fix integer overflow in ELF_ET_DYN_BASE

2015-03-24 Thread Andrey Ryabinin
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:

[PATCH] avr32: fix integer overflow in ELF_ET_DYN_BASE

2015-03-24 Thread Andrey Ryabinin
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: