[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D958900912E20642BCBC71664EFECE3E6DD198A7AE@BGMAIL02.nvidia.com>
Date: Fri, 17 Feb 2012 14:34:13 +0530
From: Venu Byravarasu <vbyravarasu@...dia.com>
To: Naotaka Hamaguchi <n.hamaguchi@...fujitsu.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
CC: KOSAKI Motohiro <kosaki.motohiro@...il.com>
Subject: RE: [PATCH] mm: mmap() sometimes succeeds even if the region to map
is invalid.
> The detail of these problems is as follows:
> 1. mmap() succeeds even if "offset" argument is a negative value, although
> it should return EINVAL in such case.
> In such case, it is actually regarded as big positive value
> because the type of "off" is "unsigned long" in the kernel.
> For example, off=-4096 (-0x1000) is regarded as
> off = 0xfffffffffffff000 (x86_64) and as off = 0xfffff000 (x86).
> It results in mapping too big offset region.
It is not true always.
Considering your example, say if page size is 4k, then PAGE_MASK = 0xFFF
hence (off & ~PAGE_MASK) will be true and " -EINVAL" will be returned.
--
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