[lkml]   [2004]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [BUG] hugetlb MAP_PRIVATE mapping vs /dev/zero
Oleg Nesterov <> wrote:
> Hugetlbfs mmap with MAP_PRIVATE becomes MAP_SHARED
> silently, but vma->vm_flags have no VM_SHARED bit.
> I think it make sense to forbid MAP_PRIVATE in
> hugetlbfs_file_mmap() because it may confuse user
> space applications. But the real bug is that reading
> from /dev/zero into hugetlb will do:
> read_zero()
> read_zero_pagealigned()
> if (vma->vm_flags & VM_SHARED)
> break; // OK if MAP_PRIVATE
> zap_page_range();
> zeromap_page_range();
> We can fix hugetlbfs_file_mmap() or read_zero_pagealigned()
> or both.

This could break existing applications, yes?

If so, would an appropriate fixup be to coerce private mappings
of hugetlb files into shared ones in-kernel?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:04    [W:0.234 / U:0.580 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site