Re: [Uclinux-dist-devel] [PATCH] mm/nommu.c: Fix improperly call of security API in mmap

From: Mike Frysinger
Date: Fri Oct 16 2009 - 03:08:10 EST


On Wed, Oct 14, 2009 at 10:08, David Howells wrote:
> <graff.yang@xxxxxxxxx> 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.
>
> So I think the attached patch is a better approach.

Acked-by: Mike Frysinger <vapier@xxxxxxxxxx>
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/