Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262499AbUDBA1j (ORCPT ); Thu, 1 Apr 2004 19:27:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263015AbUDBA1j (ORCPT ); Thu, 1 Apr 2004 19:27:39 -0500 Received: from fw.osdl.org ([65.172.181.6]:59339 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S262499AbUDBA1g (ORCPT ); Thu, 1 Apr 2004 19:27:36 -0500 Date: Thu, 1 Apr 2004 16:29:43 -0800 From: Andrew Morton To: Sridhar Samudrala Cc: hch@infradead.org, linux-kernel@vger.kernel.org Subject: Re: CONFIG_DEBUG_PAGEALLOC and virt_addr_valid() Message-Id: <20040401162943.149ee719.akpm@osdl.org> In-Reply-To: References: <20040401204407.A24608@infradead.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 28 Sridhar Samudrala wrote: > > On Thu, 1 Apr 2004, Christoph Hellwig wrote: > > > On Thu, Apr 01, 2004 at 11:11:39AM -0800, Sridhar Samudrala wrote: > > > When CONFIG_DEBUG_PAGEALLOC is enabled, i am noticing that virt_addr_valid() > > > (called from sctp_is_valid_kaddr()) is returning true even for freed objects. > > > Is this a bug or expected behavior? > > > > Generally every use of virt_addr_valid() is a bug. What are you trying to > > do? > > We are trying to validate a kernel address that is passed by the user. Is > there a better way to do that? yup. Pass the user an integer. > When an SCTP association is established, the pointer to the association > structure is passed to the user as an identifier of the association. This > identifier is used in the later calls by the user. Please don't do that. See lib/idr.c. I expect it does exactly what you want. - 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/