[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140825171820.GB8338@redhat.com>
Date: Mon, 25 Aug 2014 19:18:20 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Hugh Dickins <hughd@...gle.com>
Cc: Cyrill Gorcunov <gorcunov@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Manfred Spraul <manfred@...orfullife.com>,
Davidlohr Bueso <davidlohr.bueso@...com>,
Kees Cook <keescook@...omium.org>, Tejun Heo <tj@...nel.org>,
Andrew Vagin <avagin@...nvz.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"H. Peter Anvin" <hpa@...or.com>,
Serge Hallyn <serge.hallyn@...onical.com>,
Pavel Emelyanov <xemul@...allels.com>,
Vasiliy Kulikov <segoon@...nwall.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Michael Kerrisk <mtk.manpages@...il.com>,
Julien Tinnes <jln@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] ipc/shm: fix the historical/wrong mm->start_stack
check
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 wanting to leave a gap below the growsdown stack,
> > > but of course could argue about growsup and 1 or 4 or 5 or whatever:
> >
> > And it is not clear to me why the kernel should care at all,
>
> Care about what exactly? Leaving a gap between shm and stack?
>
> The man page says that (unless SHM_REMAP) shmat() will fail with
> EINVAL if a mapping already exists there, and I think it's fair
> to regard the vm_start of a VM_GROWSDOWN somewhat elastically.
>
> It may be that Linus's check_stack_guard_page() work in 2.6.36
> changed the importance of this shmat() check, but I'd still feel
> safer to leave it as is (while turning a blind eye to the
> VM_GROWSUP omission).
>
> >
> > > okay that we're all more interested in just removing that start_stack.
> >
> > so perhaps v2 should simply remove it? Or do you think it would be safer
> > to not do this?
>
> It would be safer to leave it, but replace the start_stack use as you did.
OK, thanks.
> 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 obviously this doesn't explain the original's 5, this was
written before check_stack_guard_page().
OK.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists