Re: [AppArmor 37/41] AppArmor: Main Part

Nick Piggin
2007-04-13T08:52:36Z

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.