Re: [PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Ingo Oeser
Hi Arjan, You wrote: > shouldn't we just fix the alignment code instead that the overflow case > doesn't align to 0??? > that sounds really odd. How? You have to align and you are out of bits for representing the next number. What is the next number you can round to? "null" right! Just remember

Re: [PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Arjan van de Ven
On Mon, 2005-03-14 at 17:55 +0800, Gordon Jin wrote: > This patch fixes a corner case in sys_mprotect(): > > Case: len is so large that will overflow to 0 after page alignment. shouldn't we just fix the alignment code instead that the overflow case doesn't align to 0??? that sounds really odd.

[PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Gordon Jin
This patch fixes a corner case in sys_mprotect(): Case: len is so large that will overflow to 0 after page alignment. E.g. len=(size_t)(-1), i.e. 0xff...ff. Expected result: POSIX spec says it should return -ENOMEM. Current result: len is aligned to 0, then treated the same as len=0 and return

[PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Gordon Jin
This patch fixes a corner case in sys_mprotect(): Case: len is so large that will overflow to 0 after page alignment. E.g. len=(size_t)(-1), i.e. 0xff...ff. Expected result: POSIX spec says it should return -ENOMEM. Current result: len is aligned to 0, then treated the same as len=0 and return

Re: [PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Arjan van de Ven
On Mon, 2005-03-14 at 17:55 +0800, Gordon Jin wrote: This patch fixes a corner case in sys_mprotect(): Case: len is so large that will overflow to 0 after page alignment. shouldn't we just fix the alignment code instead that the overflow case doesn't align to 0??? that sounds really odd. -

Re: [PATCH 2.6] fix mprotect() with len=(size_t)(-1) to return -ENOMEM

2005-03-14 Thread Ingo Oeser
Hi Arjan, You wrote: shouldn't we just fix the alignment code instead that the overflow case doesn't align to 0??? that sounds really odd. How? You have to align and you are out of bits for representing the next number. What is the next number you can round to? null right! Just remember that