From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Nikolai Dokutovich <ndokutovich@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>, Michal Hocko <mhocko@suse.com>,
Xu Xin <xu.xin@linux.dev>,
linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] selftests/mm: add a probe for FOLL_FORCE writes through /proc/self/mem
Date: Thu, 3 Dec 2026 16:28:38 +0100 [thread overview]
Message-ID: <9c6d8f6f-b9f9-41ab-af10-4cc0fca9e68f@kernel.org> (raw)
In-Reply-To: <20261201191644.44219-2-ndokutovich@gmail.com>
On 12/1/26 20:16, Nikolai Dokutovich wrote:
> mkdirty and the ksm PROT_NONE test write through /proc/self/mem into a
> mapping that is not writable. With CONFIG_PROC_MEM_FORCE_PTRACE such a
> write is only allowed for a caller that traces the target, so both tests
> fail instead of skipping on a distribution kernel.
>
> Add a helper that performs that write on a scratch mapping and caches the
> result.
>
> Signed-off-by: Nikolai Dokutovich <ndokutovich@gmail.com>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
> bool detect_huge_zeropage(void);
>
> +/*
> + * Whether a write through /proc/self/mem into a mapping that is not writable
> + * is permitted. Probed once and cached; the permission depends on the kernel
> + * configuration and on whether the caller traces the target, not on the
> + * mapping.
I'll likely reduce that down to "Whether a write through /proc/self/mem into a
mapping that is not writable is currently permitted." when applying.
> + */
> +bool proc_mem_force_write_allowed(void);
> +
> /*
> * Plan 9 FS has bugs (at least on QEMU) where certain operations fail with
> * ENOENT on unlinked files. See
--
Cheers,
David
next prev parent reply other threads:[~2026-12-03 15:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 19:16 [PATCH v5 0/3] selftests/mm: skip tests when FOLL_FORCE writes are not available Nikolai Dokutovich
2026-12-01 19:16 ` [PATCH v5 1/3] selftests/mm: add a probe for FOLL_FORCE writes through /proc/self/mem Nikolai Dokutovich
2026-12-03 15:28 ` David Hildenbrand (Arm) [this message]
2026-12-01 19:16 ` [PATCH v5 2/3] selftests/mm: skip the mkdirty ptrace write tests without FOLL_FORCE Nikolai Dokutovich
2026-12-03 15:28 ` David Hildenbrand (Arm)
2026-12-01 19:16 ` [PATCH v5 3/3] selftests/mm: skip the ksm PROT_NONE test " Nikolai Dokutovich
2026-12-03 15:29 ` David Hildenbrand (Arm)
2026-12-03 15:31 ` [PATCH v5 0/3] selftests/mm: skip tests when FOLL_FORCE writes are not available David Hildenbrand
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=9c6d8f6f-b9f9-41ab-af10-4cc0fca9e68f@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=ndokutovich@gmail.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=vbabka@kernel.org \
--cc=xu.xin@linux.dev \
/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