All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Yibin Liu <liuyibin@hygon.cn>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	Liam.Howlett@oracle.com, viro@zeniv.linux.org.uk,
	brauner@kernel.org, mjguzik@gmail.com, wujianyong@hygon.cn,
	huangsj@hygon.cn, zhongyuan@hygon.cn
Subject: Re: [PATCH] mm: Add RWH_RMAP_EXCLUDE flag to exclude files from rmap sharing
Date: Tue, 21 Apr 2026 15:38:45 +0100	[thread overview]
Message-ID: <aeeL9TVSZJe3sD6u@casper.infradead.org> (raw)
In-Reply-To: <20260421020932.3212532-1-liuyibin@hygon.cn>

On Tue, Apr 21, 2026 at 10:09:32AM +0800, Yibin Liu wrote:
> +	/* Prevent truncate on files marked as RMAP_EXCLUDE (e.g., libc, ld.so) */
> +	if (filp && (filp->f_mode & FMODE_RMAP_EXCLUDE))
> +		return -EPERM;

You can't do this.  It means I can prevent anybody else from truncating
a file which I can open.


  reply	other threads:[~2026-04-21 14:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21  2:09 [PATCH] mm: Add RWH_RMAP_EXCLUDE flag to exclude files from rmap sharing Yibin Liu
2026-04-21 14:38 ` Matthew Wilcox [this message]
2026-04-21 15:37 ` Pedro Falcato
2026-04-22  7:19   ` David Hildenbrand (Arm)
2026-04-21 19:46 ` Mateusz Guzik
2026-04-22 13:03   ` 答复: " Yibin Liu
2026-04-22 10:49 ` Lorenzo Stoakes
2026-04-22 12:51   ` 答复: " Yibin Liu
2026-04-22 16:16     ` Lorenzo Stoakes
2026-04-24  1:08       ` 答复: " Yibin Liu
2026-04-24  3:20         ` Matthew Wilcox
2026-04-24  6:20           ` Mateusz Guzik
2026-04-24  6:54             ` Mateusz Guzik
  -- strict thread matches above, loose matches on Subject: below --
2026-05-01  6:26 kernel test robot

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=aeeL9TVSZJe3sD6u@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=huangsj@hygon.cn \
    --cc=linux-mm@kvack.org \
    --cc=liuyibin@hygon.cn \
    --cc=mjguzik@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wujianyong@hygon.cn \
    --cc=zhongyuan@hygon.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.