Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934942AbXKPVu7 (ORCPT ); Fri, 16 Nov 2007 16:50:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757334AbXKPVuv (ORCPT ); Fri, 16 Nov 2007 16:50:51 -0500 Received: from mx1.redhat.com ([66.187.233.31]:48670 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757483AbXKPVuv (ORCPT ); Fri, 16 Nov 2007 16:50:51 -0500 Subject: Re: [PATCH 2/3] mmap: round mmap hint address above mmap_min_addr From: Eric Paris To: James Morris Cc: linux-kernel@vger.kernel.org, sds@tycho.nsa.gov, selinux@tycho.nsa.gov, alan@redhat.com, chrisw@redhat.com, hpa@zytor.com, akpm@linux-foundation.org In-Reply-To: References: <1195246486.2924.87.camel@localhost.localdomain> Content-Type: text/plain Date: Fri, 16 Nov 2007 16:49:53 -0500 Message-Id: <1195249793.2924.99.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1042 Lines: 28 On Sat, 2007-11-17 at 08:42 +1100, James Morris wrote: > On Fri, 16 Nov 2007, Eric Paris wrote: > > > +#ifdef CONFIG_SECURITY > > + /* > > + * If a hint addr is less than mmap_min_addr change addr to be as > > + * low as possible but still greater than mmap_min_addr > > + */ > > + if (!(flags & MAP_FIXED) && ((void *)addr != NULL) && > > + (addr < mmap_min_addr)) > > + addr = PAGE_ALIGN(mmap_min_addr); > > +#endif > > Please make this a static inline which is optimized away with > !CONFIG_SECURITY. Where do you think these should go? You think I should instead have a static inline function in both mmap.c and nommu.c so the CONFIG check isn't scattered in this code but still in this file? Or did you actually want something in security.h so I only have the code once? -Eric - 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/