[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e0fb38c0910160801o50346a5cm763d79cab98272a5@mail.gmail.com>
Date: Fri, 16 Oct 2009 11:01:38 -0400
From: Eric Paris <eparis@...isplace.org>
To: David Howells <dhowells@...hat.com>
Cc: graff.yang@...il.com, linux-kernel@...r.kernel.org,
gyang@...ckfin.uclinux.org, akpm@...ux-foundation.org,
uclinux-dist-devel@...ckfin.uclinux.org,
Graff Yang <graf.yang@...log.com>,
linux-security-module@...r.kernel.org
Subject: Re: [PATCH] mm/nommu.c: Fix improperly call of security API in mmap
On Wed, Oct 14, 2009 at 10:08 AM, David Howells <dhowells@...hat.com> wrote:
> <graff.yang@...il.com> wrote:
>
>> The original code calling security_file_mmap() use user's hint address
>> as it's 5th argument(addr). This is improper, as the hint address may be
>> NULL.
>> In this case, the security_file_mmap() may incorrectly return -EPERM.
>>
>> This patch moved the calling of security_file_mmap() out of
>> validate_mmap_request() to do_mmap_pgoff(), and call this
>> security API with the address that attempting to mmap.
>
> I think this is the wrong approach. Firstly, the hint is cleared in NOMMU
> mode, and secondly, I think that the check against the minimum LSM address is
> pointless in NOMMU mode too.
I really don't like seeing such irrelevant (that's not the right word,
but I can't think what is) ifdefs creeping down into the security
layer as LSM authors are likely to mess them up in the future. I'd
probably rather see the addr_only argument changed into a flags field.
One for addr_only and one flag for not_addr. The nommu case could
just set the not_addr flag and it's obvious how the LSMs (or
capabilities if !CONFIG_SECURITY) should handle it, also works if some
other future need arises...
-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists