lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v1] mm/gup: fix FOLL_FORCE COW security issue and remove FOLL_COW
    From
    On 09.08.22 22:20, Linus Torvalds wrote:
    > On Tue, Aug 9, 2022 at 1:14 PM Linus Torvalds
    > <torvalds@linux-foundation.org> wrote:
    >>
    >> But as there are two bits, I'm sure somebody ends up touching one and
    >> not the other.
    >
    > Ugh. The nommu code certainly does odd things here. That just looks wrong.
    >
    > And the hugetlb code does something horrible too, but never *sets* it,
    > so it looks like some odd subset of VM_SHARED.

    mm/mmap.c:do_mmap() contains the magic bit

    switch (flags & MAP_TYPE) {
    case MAP_SHARED:
    ...
    case MAP_SHARED_VALIDATE:
    ...
    vm_flags |= VM_SHARED | VM_MAYSHARE;
    if (!(file->f_mode & FMODE_WRITE))
    vm_flags &= ~(VM_MAYWRITE | VM_SHARED);
    fallthrough;


    VM_SHARED semantics are confusing.


    --
    Thanks,

    David / dhildenb

    \
     
     \ /
      Last update: 2022-08-09 22:27    [W:3.258 / U:0.976 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site