linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Xu <jeffxu@chromium.org>
To: linux-mm@kvack.org, linux-hardening@vger.kernel.org
Subject: inconsistence in mprotect_fixup mlock_fixup madvise_update_vma
Date: Mon, 12 Jun 2023 18:04:39 -0700	[thread overview]
Message-ID: <CABi2SkWx_BnEHzGqqqbDMJi+vi-5a7XkQUCkyesN5PUtk23SgQ@mail.gmail.com> (raw)

Hello,

There seems to be inconsistency in different VMA fixup
implementations, for example:
mlock_fixup will skip VMA that is hugettlb, etc, but those checks do
not exist in mprotect_fixup and madvise_update_vma. Wouldn't this be a
problem? the merge/split skipped by mlock_fixup, might get acted on in
the madvice/mprotect case.

mlock_fixup currently check for
if (newflags == oldflags || (oldflags & VM_SPECIAL) ||
is_vm_hugetlb_page(vma) || vma == get_gate_vma(current->mm) ||
vma_is_dax(vma) || vma_is_secretmem(vma))

Should there be a common function to handle VMA merge/split ?

Best
-Jeff


             reply	other threads:[~2023-06-13  1:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  1:04 Jeff Xu [this message]
2023-06-13 15:26 ` Jeff Xu
2023-06-13 20:16   ` Peter Xu
2023-06-13 21:29     ` Jeff Xu
2023-06-14  1:18       ` Liam R. Howlett
2023-06-14 12:57         ` Mike Rapoport
2023-06-20 22:29           ` Jeff Xu
2023-06-21  5:55             ` Mike Rapoport
2023-06-21 16:08               ` Jeff Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABi2SkWx_BnEHzGqqqbDMJi+vi-5a7XkQUCkyesN5PUtk23SgQ@mail.gmail.com \
    --to=jeffxu@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox