From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: sys_kcmp Date: Tue, 25 Sep 2012 00:35:12 +0400 Message-ID: <20120924203512.GF24172@moon> References: <20120922114549.GA11610@moon> <20120922132046.GA4260@flint.arm.linux.org.uk> <20120922114723.d7f07fb6.akpm@linux-foundation.org> <1348503709.20929.40.camel@deneb.redhat.com> <20120924164942.GH16532@moon> <20120924174256.GD24172@moon> <87lifzuvey.fsf@xmission.com> <20120924185119.GI16532@moon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20120924185119.GI16532@moon> Sender: linux-kernel-owner@vger.kernel.org To: "Eric W. Biederman" Cc: Mark Salter , Andrew Morton , Russell King , Geert Uytterhoeven , Kees Cook , linux-kernel@vger.kernel.org, Linux-Arch , Heiko Carstens , "H. Peter Anvin" , Pavel Emelyanov List-Id: linux-arch.vger.kernel.org On Mon, Sep 24, 2012 at 10:51:19PM +0400, Cyrill Gorcunov wrote: > > I expect what you want is a call to access_ok, rather than hard coding > > details about task layout here. This test certainly looks wrong > > for a 32bit process on a 64bit kernel. If I read your test right it > > appears I can set values of say 0x100000000 on a 32bit process... > > > > As for mmap_min_addr I would expect your find_vma check would make that > > test unnecessary, simply by not finding a vma... > > Good point, Eric, thanks! I'm cooking a new patch now. Btw, Eric, I somehow miss one bit -- how would you set this 0x100000000 if TASK_SIZE is a macro which does check for TIF_ADDR32 and sets limit acordingly? What i'm missing? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f174.google.com ([209.85.217.174]:52222 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757874Ab2IXUfT (ORCPT ); Mon, 24 Sep 2012 16:35:19 -0400 Date: Tue, 25 Sep 2012 00:35:12 +0400 From: Cyrill Gorcunov Subject: Re: sys_kcmp Message-ID: <20120924203512.GF24172@moon> References: <20120922114549.GA11610@moon> <20120922132046.GA4260@flint.arm.linux.org.uk> <20120922114723.d7f07fb6.akpm@linux-foundation.org> <1348503709.20929.40.camel@deneb.redhat.com> <20120924164942.GH16532@moon> <20120924174256.GD24172@moon> <87lifzuvey.fsf@xmission.com> <20120924185119.GI16532@moon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120924185119.GI16532@moon> Sender: linux-arch-owner@vger.kernel.org List-ID: To: "Eric W. Biederman" Cc: Mark Salter , Andrew Morton , Russell King , Geert Uytterhoeven , Kees Cook , linux-kernel@vger.kernel.org, Linux-Arch , Heiko Carstens , "H. Peter Anvin" , Pavel Emelyanov Message-ID: <20120924203512.EVesBswG9atV_cM7BwLACvgK9ET3iokFMdtqyF5PUhE@z> On Mon, Sep 24, 2012 at 10:51:19PM +0400, Cyrill Gorcunov wrote: > > I expect what you want is a call to access_ok, rather than hard coding > > details about task layout here. This test certainly looks wrong > > for a 32bit process on a 64bit kernel. If I read your test right it > > appears I can set values of say 0x100000000 on a 32bit process... > > > > As for mmap_min_addr I would expect your find_vma check would make that > > test unnecessary, simply by not finding a vma... > > Good point, Eric, thanks! I'm cooking a new patch now. Btw, Eric, I somehow miss one bit -- how would you set this 0x100000000 if TASK_SIZE is a macro which does check for TIF_ADDR32 and sets limit acordingly? What i'm missing?