From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 22 19:46:57 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DB361065674; Mon, 22 Mar 2010 19:46:57 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay1.uni-muenster.de (ZIVM-RELAY1.UNI-MUENSTER.DE [128.176.192.12]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF328FC18; Mon, 22 Mar 2010 19:46:55 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.51,289,1267398000"; d="scan'208";a="299844434" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER03.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay1.uni-muenster.de with ESMTP; 22 Mar 2010 20:46:54 +0100 Received: by ZIVMAILUSER03.UNI-MUENSTER.DE (Postfix, from userid 149459) id 135511B0750; Mon, 22 Mar 2010 20:46:54 +0100 (CET) Date: Mon, 22 Mar 2010 20:46:53 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: John Baldwin , Message-ID: In-Reply-To: <201003221329.55369.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Re: [patch] somebody please fix this outstanding mmap(2) bug X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2010 19:46:57 -0000 John Baldwin schrieb am 2010-03-22: > On Monday 22 March 2010 11:07:43 am Alexander Best wrote: > > could somebody please commit this patch? it's been around forever > > (2003 or > > 2004) and fixes mmap so the offset argument is being ignored when > > MAP_ANON > is > > defined (just like the mmap(2) manual says). right now the offset > > argument > is > > being taken into account although MAP_ANON is set!!! > > the pr is kern/71258 (including a little c app to demonstrate the > > bug) > > i've also sent a followup patch to the pr which returns EINVAL if > > the offset > > is non zero and MAP_ANON is set, but i guess that might break some > > code. > I think we should go the EINVAL route, and I will commit the patch > you did to > add that. thanks. :) i've checked what posix sais about this and since it doesn't know MAP_ANON there's no real rule for this case. the only thing that comes close is: "The mmap() function may fail if: [EINVAL] The addr argument (if MAP_FIXED was specified) or off is not a multiple of the page size as returned by sysconf(), or is considered invalid by the implementation." -- Alexander Best