From: Andrew Morton <email@example.com> To: Song Liu <firstname.lastname@example.org> Cc: "email@example.com" <firstname.lastname@example.org>, "email@example.com" <firstname.lastname@example.org>, "email@example.com" <firstname.lastname@example.org>, Kernel Team <Kernelemail@example.com>, "firstname.lastname@example.org" <email@example.com>, "firstname.lastname@example.org" <email@example.com>, "firstname.lastname@example.org" <email@example.com> Subject: Re: [PATCH v2 0/3] Enable THP for text section of non-shmem files Date: Wed, 19 Jun 2019 18:13:54 -0700 Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <BA4D64DA-4F48-4683-8512-0402B9533EE7@fb.com> On Tue, 18 Jun 2019 21:48:16 +0000 Song Liu <email@example.com> wrote: > > I'm wondering if this limitation can be abused in some fashion: mmap a > > file to which you have read permissions, run madvise(MADV_HUGEPAGE) and > > thus prevent the file's owner from being able to modify the file? Or > > something like that. What are the issues and protections here? > > In this case, the owner need to make a copy of the file, and then remove > and update the original file. > > In this version, we want either split huge page on writes, or fail the > write when we cannot split. However, the huge page information is only > available at page level, and on the write path, page level information > is not available until write_begin(). So it is hard to stop writes at > earlier stage. Therefore, in this version, we leverage i_mmap_writable, > which is at address_space level. So it is easier to stop writes to the > file. > > This is a temporary behavior. And it is gated by the config. So I guess > it is OK. It works well for our use cases though. Once we have better > write support, we can remove the limitation. > > If this is too weird, I am also open to suggestions. Well, it's more than weird? This permits user A to deny service to user B? User A can, maliciously or accidentally, prevent user B from modifying a file which user B has permission to modify? Such as, umm, /etc/hosts?
next prev parent reply index Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-14 18:22 Song Liu 2019-06-14 18:22 ` [PATCH v2 1/3] mm: check compound_head(page)->mapping in filemap_fault() Song Liu 2019-06-17 14:59 ` Rik van Riel 2019-06-14 18:22 ` [PATCH v2 2/3] mm,thp: stats for file backed THP Song Liu 2019-06-17 15:00 ` Rik van Riel 2019-06-21 12:50 ` Kirill A. Shutemov 2019-06-21 14:09 ` Song Liu 2019-06-14 18:22 ` [PATCH v2 3/3] mm,thp: add read-only THP support for (non-shmem) FS Song Liu 2019-06-17 15:42 ` Rik van Riel 2019-06-21 12:58 ` Kirill A. Shutemov 2019-06-21 13:08 ` Song Liu 2019-06-21 13:11 ` Kirill A. Shutemov 2019-06-18 21:12 ` [PATCH v2 0/3] Enable THP for text section of non-shmem files Andrew Morton 2019-06-18 21:48 ` Song Liu 2019-06-20 1:13 ` Andrew Morton [this message] 2019-06-20 2:04 ` Song Liu 2019-06-19 6:26 ` Song Liu
Reply instructions: You may reply publically 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 \ --firstname.lastname@example.org \ --email@example.com \ --cc=Kernelfirstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ /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
Linux-mm Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \ firstname.lastname@example.org email@example.com public-inbox-index linux-mm Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kvack.linux-mm AGPL code for this site: git clone https://public-inbox.org/ public-inbox