lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v1] mm/gup: disallow FOLL_FORCE|FOLL_WRITE on hugetlb mappings
    On 31.10.22 17:14, Jason Gunthorpe wrote:
    > On Mon, Oct 31, 2022 at 04:25:24PM +0100, David Hildenbrand wrote:
    >> Cc: Andrew Morton <akpm@linux-foundation.org>
    >> Cc: Mike Kravetz <mike.kravetz@oracle.com>
    >> Cc: Peter Xu <peterx@redhat.com>
    >> Cc: John Hubbard <jhubbard@nvidia.com>
    >> Cc: Jason Gunthorpe <jgg@nvidia.com>
    >> Reported-by: syzbot+f0b97304ef90f0d0b1dc@syzkaller.appspotmail.com
    >> Signed-off-by: David Hildenbrand <david@redhat.com>
    >> ---
    >>
    >> I assume this has been broken at least since 2014, when mm/gup.c came to
    >> life. I failed to come up with a suitable Fixes tag quickly.
    >
    > I'm worried this would break RDMA over hugetlbfs maps - which is a
    > real thing people do.
    >
    > MikeK do you have test cases?

    This patch here only silences the warning. The warning+failing is
    already in 6.0, and so far nobody (besides syzbot) complained.

    RDMA (due to FOLL_FORCE) would now fail (instead of doing something
    wrong) on MAP_PRIVATE hugetlb mappings that are R/O. Do we have any
    actual examples of such RDMA usage? I was able to understand why this
    case (MAP_PRIVATE, PROT_READ) is important for !hugetlb, but I don't
    immediately see under which situations this would apply to hugetlb.

    While we could implement FOLL_FORCE for hugetlb, at least for RDMA we
    will be moving away from FOLL_FORCE instead --- I'll be posting these
    patches shortly.

    So considering upcoming changes, at least RDMA is rather a bad excuse
    for more widespread FOLL_FORCE support.

    --
    Thanks,

    David / dhildenb

    \
     
     \ /
      Last update: 2022-11-02 10:18    [W:3.804 / U:1.756 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site