Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Oleg Nesterov
On 08/25, Hugh Dickins wrote: > > On Mon, 25 Aug 2014, Oleg Nesterov wrote: > > On 08/25, Hugh Dickins wrote: > > > > > And I think I'll let Linus's guard page justify your 4 (to match comment) > > > in place of the original's mysterious 5. > > > > Ah, thanks again. Yes, if we want to guarantee 4 p

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Hugh Dickins
On Mon, 25 Aug 2014, Oleg Nesterov wrote: > On 08/25, Hugh Dickins wrote: > > > And I think I'll let Linus's guard page justify your 4 (to match comment) > > in place of the original's mysterious 5. > > Ah, thanks again. Yes, if we want to guarantee 4 pages we should check 5. > > Although obviou

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Oleg Nesterov
On 08/25, Hugh Dickins wrote: > > On Mon, 25 Aug 2014, Oleg Nesterov wrote: > > On 08/24, Hugh Dickins wrote: > > > > > > I'd say it comes earlier, from Christoph Rohland's 2.4.17-pre7's > > > "Add missing checks on shmat()", though I didn't find more than that. > > > > > > We can all understand wa

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Hugh Dickins
On Mon, 25 Aug 2014, Oleg Nesterov wrote: > On 08/24, Hugh Dickins wrote: > > > > I'd say it comes earlier, from Christoph Rohland's 2.4.17-pre7's > > "Add missing checks on shmat()", though I didn't find more than that. > > > > We can all understand wanting to leave a gap below the growsdown stack

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Oleg Nesterov
On 08/24, Hugh Dickins wrote: > > On Sat, 23 Aug 2014, Oleg Nesterov wrote: > > On 08/23, Cyrill Gorcunov wrote: > > > > > > On Sat, Aug 23, 2014 at 04:43:27PM +0200, Oleg Nesterov wrote: > > > > The ->start_stack check in do_shmat() looks ugly and simply wrong. > > > > > > > > 1. ->start_stack is

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-25 Thread Oleg Nesterov
On 08/24, Manfred Spraul wrote: > > On 08/23/2014 04:43 PM, Oleg Nesterov wrote: >> The ->start_stack check in do_shmat() looks ugly and simply wrong. >> >> 1. ->start_stack is only valid right after exec(), the application >> can switch to another stack and even unmap this area. >> >> 2. The r

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-24 Thread Hugh Dickins
On Sat, 23 Aug 2014, Oleg Nesterov wrote: > On 08/23, Cyrill Gorcunov wrote: > > > > On Sat, Aug 23, 2014 at 04:43:27PM +0200, Oleg Nesterov wrote: > > > The ->start_stack check in do_shmat() looks ugly and simply wrong. > > > > > > 1. ->start_stack is only valid right after exec(), the application

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-24 Thread Manfred Spraul
On 08/23/2014 04:43 PM, Oleg Nesterov wrote: The ->start_stack check in do_shmat() looks ugly and simply wrong. 1. ->start_stack is only valid right after exec(), the application can switch to another stack and even unmap this area. 2. The reason for this check is not clear at all. The appl

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-23 Thread Oleg Nesterov
On 08/23, Cyrill Gorcunov wrote: > > On Sat, Aug 23, 2014 at 04:43:27PM +0200, Oleg Nesterov wrote: > > The ->start_stack check in do_shmat() looks ugly and simply wrong. > > > > 1. ->start_stack is only valid right after exec(), the application > >can switch to another stack and even unmap thi

Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-23 Thread Cyrill Gorcunov
On Sat, Aug 23, 2014 at 04:43:27PM +0200, Oleg Nesterov wrote: > The ->start_stack check in do_shmat() looks ugly and simply wrong. > > 1. ->start_stack is only valid right after exec(), the application >can switch to another stack and even unmap this area. > > 2. The reason for this check is

[PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack check

2014-08-23 Thread Oleg Nesterov
The ->start_stack check in do_shmat() looks ugly and simply wrong. 1. ->start_stack is only valid right after exec(), the application can switch to another stack and even unmap this area. 2. The reason for this check is not clear at all. The application should know what it does. And why 4 p