From: Nick Piggin Subject: Re: [AppArmor 37/41] AppArmor: Main Part Date: Fri, 13 Apr 2007 18:52:15 +1000 Message-ID: <461F44BF.9030803@yahoo.com.au> References: <20070412090809.917795000@suse.de> <20070412090848.752885000@suse.de> <20070412113723.2ec7e4f0@the-village.bc.nu> <200704131048.17846.agruen@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , jjohansen@suse.de, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, chrisw@sous-sol.org To: Andreas Gruenbacher Return-path: Received: from smtp101.mail.mud.yahoo.com ([209.191.85.211]:32724 "HELO smtp101.mail.mud.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753278AbXDMIwX (ORCPT ); Fri, 13 Apr 2007 04:52:23 -0400 In-Reply-To: <200704131048.17846.agruen@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Andreas Gruenbacher wrote: > On Thursday 12 April 2007 12:37, Alan Cox wrote: > >>>+ if (PTR_ERR(sa->name) == -ENOENT && (check & AA_CHECK_FD)) >>>+ denied_mask = 0; >> >>Now there is an interesting question. Is PTR_ERR() safe for kernel >>pointers on all platforms or just for user ones ? > > > It's used for kernel pointers all over the place and mmap also mixes user > addresses with -Exxx, so it's definitely supposed to work. I'm not sure how > exactly the topmost page is kept from getting mapped. Yeah, the comments indicate it was first used for dentries. I wonder if it shouldn't be using the NULL page instead? (ie 0-4095) -- SUSE Labs, Novell Inc.