[Bug 858959] New: libhugetlbfs: mmap() with misaligned length 0x1000 got succeeded
https://bugzilla.novell.com/show_bug.cgi?id=858959 https://bugzilla.novell.com/show_bug.cgi?id=858959#c0 Summary: libhugetlbfs: mmap() with misaligned length 0x1000 got succeeded Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: mhocko@suse.cz ReportedBy: cachen@suse.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- STEPS: 1. install libhugetlbfs package 2. echo 128 >/proc/sys/vm/nr_hugepages 3. run /usr/lib64/libhugetlbfs/tests/run_tests.py PROBLEMS: misalign (2M: 64) test failed Starting testcase "/usr/lib64/libhugetlbfs/tests/obj64/misalign", pid 7135 Mapped at 0x2aaaaac00000, length 0x200000 FAIL mmap() with misaligned length 0x1000 succeeded This testcase ensures that attempted hugepage mappings with parameters which are not correctly hugepage aligned are rejected -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=858959 https://bugzilla.novell.com/show_bug.cgi?id=858959#c1 Michal Hocko <mhocko@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mhocko@suse.com --- Comment #1 from Michal Hocko <mhocko@suse.com> 2014-01-16 09:53:48 CET --- OK, so it seems that the testcase tries to do mmap(NULL, 0x1000, prot, MAP_HUGETLB, -1, 0) or something like that. It assumes that the length has to be aligned to the units of pages which back the mapping. This assumption is too strict and in fact doesn't comply with POSIX http://pubs.opengroup.org/onlinepubs/7908799/xsh/mmap.html " Thus, while the argument len need not meet a size or alignment constraint, the implementation will include, in any mapping operation, any partial page specified by the range [pa, pa + len). " And the kernel code does exactly this for both regular pages and hugetlb pages as well. Therefore the objective for the test case which is: /* * Test rationale: * * Just as normal mmap()s can't have an address, length or offset * which is not page aligned, so hugepage mmap()s can't have an * address, length or offset with is not hugepage aligned. * * However, from time to time when the various mmap() / * get_unmapped_area() paths are updated, somebody misses one of the * necessary checks for the hugepage paths. This testcase ensures * that attempted hugepage mappings with parameters which are not * correctly hugepage aligned are rejected. */ doesn't hold for the length part (other 2 are valid). What might be relevant and interesting to test though is whether the partial pages are handled correctly. Something like mmap hugepagesize + few bytes and then access 2*hugepagesize long area. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=858959 https://bugzilla.novell.com/show_bug.cgi?id=858959#c2 Michal Hocko <mhocko@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #2 from Michal Hocko <mhocko@suse.com> 2014-02-17 09:25:37 CET --- I guess we can close this as invalid. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=858959 https://bugzilla.novell.com/show_bug.cgi?id=858959#c3 calen chen <cachen@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #3 from calen chen <cachen@suse.com> 2014-02-17 09:43:53 UTC --- (In reply to comment #2)
I guess we can close this as invalid.
Agree! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com