From: sashiko-bot@kernel.org
Cc: linux-security-module@vger.kernel.org
Subject: Re: [PATCH] tomoyo: Drop FOLL_FORCE from tomoyo_dump_page()
Date: Sat, 28 Nov 2026 18:06:43 +0000 [thread overview]
Message-ID: <sashiko-outbox-238944@kernel.org> (raw)
In-Reply-To: <3c1a731469fb589685dd2168f7c8def736d806cf.1795863061.git.chris@chrisdown.name>
> tomoyo_dump_page() reads the argv and envp pages of the nascent exec mm
> with get_user_pages_remote(..., FOLL_FORCE, ...). Its own comment says it
> does the same thing as get_arg_page(bprm, pos, 0) in fs/exec.c, but
> get_arg_page() stopped passing FOLL_FORCE in
> commit cd57e443831d ("exec: Remove FOLL_FORCE for stack setup"), so the
> two have drifted apart.
>
> FOLL_FORCE only matters here if the page sits in a VMA that is not
> readable. That can't happen: tomoyo_dump_page() is called from the
> bprm_check_security hook, which runs before the binfmt handler calls
> setup_arg_pages(), and at that point the only VMA in bprm->mm is the
> stack VMA created by create_init_stack_vma() with VMA_STACK_FLAGS. Those
> are built from the architecture's VMA_STACK_DEFAULT_FLAGS, which falls
> back to VMA_DATA_DEFAULT_FLAGS. Every definition of either in the tree
> is built from VMA_DATA_FLAGS_EXEC, VMA_DATA_FLAGS_TSK_EXEC or
> VMA_DATA_FLAGS_NON_EXEC, and all three include VMA_READ_BIT and
> VMA_MAYREAD_BIT. Reading without FOLL_FORCE therefore works for every
> page tomoyo_dump_page() can be asked for.
>
> FOLL_FORCE is being removed from callers that are not really ptrace so
> that it can eventually be renamed to FOLL_PTRACE. Let's drop it here
> too, which also brings the code back in line with its comment.
>
> No functional change is intended.
>
> Signed-off-by: Chris Down <chris@chrisdown.name>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/3c1a731469fb589685dd2168f7c8def736d806cf.1795863061.git.chris@chrisdown.name?part=1
prev parent reply other threads:[~2026-11-28 18:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 18:04 [PATCH] tomoyo: Drop FOLL_FORCE from tomoyo_dump_page() Chris Down
2026-11-28 18:06 ` sashiko-bot [this message]
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=sashiko-outbox-238944@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sashiko-reviews@lists.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