Re: [PATCH 0/3] selftests/mm: skip tests when FOLL_FORCE writes are denied

From: David Hildenbrand (Arm)

Date: Mon Nov 30 2026 - 06:16:05 EST


On 11/29/26 05:00, Nikolai Dokutovich wrote:
> A write through /proc/self/mem into a mapping that is not writable is
> performed by the kernel as a forced write. Since commit
> 41e8149c8892 ("proc: add config & param to block forcing mem writes")
> such a write is refused unless the writing task is tracing the target
> task, the kernel was built with CONFIG_PROC_MEM_ALWAYS_FORCE, or it was
> booted with proc_mem.force_override=always. Commit
> 599bbba5a36f ("proc: make PROC_MEM_FORCE_PTRACE the Kconfig default") made
> the refusal the default.
>
> Commit a3907a3169d0 ("selftests/mm: specify requirement for
> PROC_MEM_ALWAYS_FORCE=y") set CONFIG_PROC_MEM_ALWAYS_FORCE=y in mm/config.
> That fragment is merged into the kernel configuration only when it is
> requested, so a test binary run against a distribution kernel is not
> covered, and mkdirty and the ksm PROT_NONE test then report failures
> instead of skipping:
>
> not ok 1 write() failed
> not ok 5 ptrace write failed

Ran into this myself when testing stuff over the weekend.

--
Cheers,

David