Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262442AbVAZXNj (ORCPT ); Wed, 26 Jan 2005 18:13:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262441AbVAZXMx (ORCPT ); Wed, 26 Jan 2005 18:12:53 -0500 Received: from holomorphy.com ([66.93.40.71]:58794 "EHLO holomorphy.com") by vger.kernel.org with ESMTP id S262442AbVAZRZn (ORCPT ); Wed, 26 Jan 2005 12:25:43 -0500 Date: Wed, 26 Jan 2005 09:25:38 -0800 From: William Lee Irwin III To: Rik van Riel Cc: Andrew Morton , linux-kernel@vger.kernel.org, James Antill , Bryn Reeves Subject: Re: don't let mmap allocate down to zero Message-ID: <20050126172538.GN10843@holomorphy.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: The Domain of Holomorphy User-Agent: Mutt/1.5.6+20040907i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1118 Lines: 26 On Wed, Jan 26, 2005 at 11:18:08AM -0500, Rik van Riel wrote: > With some programs the 2.6 kernel can end up allocating memory > at address zero, for a non-MAP_FIXED mmap call! This causes > problems with some programs and is generally rude to do. This > simple patch fixes the problem in my tests. > Make sure that we don't allocate memory all the way down to zero, > so the NULL pointer never gets covered up with anonymous memory > and we don't end up violating the C standard. > Signed-off-by: Rik van Riel SHLIB_BASE does not appear to be present in 2.6.9; perhaps something else is going on. I think we are better off: (a) checking for hitting zero explicitly as opposed to enforcing a randomly-chosen lower limit for addresses (b) enforcing vma allocation above FIRST_USER_PGD_NR*PGDIR_SIZE, to which SHLIB_BASE bears no relation. -- wli - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/