archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <>
To: Miklos Szeredi <>
Cc:, linux-mm <>,
	Chengguang Xu <>,
	overlayfs <>
Subject: Re: [PATCH] ovl: fix mmap denywrite
Date: Wed, 23 Jun 2021 13:41:02 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Am 22.06.21 um 17:10 schrieb Miklos Szeredi:
> On Tue, 22 Jun 2021 at 14:43, Christian König <> wrote:
>> Am 22.06.21 um 14:30 schrieb Miklos Szeredi:
>>> Overlayfs did not honor positive i_writecount on realfile for VM_DENYWRITE
>>> mappings.  Similarly negative i_mmap_writable counts were ignored for
>>> VM_SHARED mappings.
>>> Fix by making vma_set_file() switch the temporary counts obtained and
>>> released by mmap_region().
>> Mhm, I don't fully understand the background but that looks like
>> something specific to overlayfs to me.
>> So why are you changing the common helper?
> Need to hold the temporary counts until the final ones are obtained in
> vma_link(), which is out of overlayfs' scope.

Ah! So basically we need to move the denial counts which mmap_region() 
added to the original file to the new one as well. That's indeed a 
rather good point.

Can you rather change the vma_set_file() function to return the error 
and add a __must_check?

I can take care fixing the users in DMA-buf and DRM subsystem.


> Thanks,
> Miklos

  reply	other threads:[~2021-06-23 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 12:30 [PATCH] ovl: fix mmap denywrite Miklos Szeredi
2021-06-22 12:43 ` Christian König
2021-06-22 15:10   ` Miklos Szeredi
2021-06-23 11:41     ` Christian König [this message]
2021-07-09 13:48       ` Miklos Szeredi
2021-07-12 11:15         ` Christian König
2021-06-23  6:06 ` 回复:[PATCH] " Chengguang 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:

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

  git send-email \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).